The Game of Life

This version of the ubiquitous automaton -in straight Javascript- started as a demonstration about accessing the HTML Document Object Model (DOM).

The idea popped out after reading an article about John von Neumann, and his model for a self-replicating machine. This problem was in turn the inspiration for John Conway to devise The Game of Life.
A very good description of the game and its rules can be found in this link to Wikipedia

Not all browsers are born equal

Internet Explorer takes ten times longer than Firefox to read and write colour information into the DOM. It seems that IE does not perform well when accessing the Document Object Model.

That is the reason of the Time label at the bottom of the grid. Tip of the hat to Dushan, for suggesting a solution to this perplexing issue.
Add to Google

Using this script as a Google Gadget

Click on the Google button above and the XML version of this page will be automatically loaded onto your iGoogle page. Easy.

Using this script in your website

  • Download the full project in a ZIP archive: this is the better alternative if you plan to extend or modify the script with your own fonts and colours.

    Download ZIP (6 KBytes)

  • Use a FRAME or IFRAME from your website: we host the script and images.

    All you need is to add the following code to your site

Disclaimer: This code is posted "as is", with a Creative Commons license and neither Carlos Labs nor any of its representatives guarantee the suitability of this script, or assume any responsibility for your actions.
This script is free to use on any software project, free or otherwise, provided you credit Carlos Labs and you do not remove the header in the script.
Project: 200711B