I realized one day that I had never implemented Conway’s Game of Life, which is something of a rite of passage for young computer-science students. As I opted for a more non-traditional path to the software profession, I somehow missed that fun, even though I’ve made a point of implementing other computer-sciency things like it.
While the game itself is actually quite simple (look at the generation method in the source code to see just how simple), the notion of implementing it on a self-contained web page and making it as fast as possible seemed intriguing, so I dived in. About six hours later I had it pretty much finished. Optimizing it took
one more day several more days as new optimizations occurred to me.
The “Step” button will let you move forward one generation at a time to watch how the cells interact with each other. The link labeled “Link to current board state” will let you save a link to the cellular configuration that you see at any given time.
Settings (Click “Stop” to Edit, “Start” to Activate)
Here are a few links to some interesting boards:
If you’d like to examine the source without all the WordPress clutter or download the page to play with on your own system, you can take a look at the stand-alone page that implements the same code.