JavaScript Game of Life

Contact Me

The Game of Life is a generative application that starts by setting initial conditions and letting an algorithm take over, frequently generating surprising results. In The Game of Life, devised by the British mathematician John Horton Conway in 1970, the initial conditions are:

  • 1. Any live cell with fewer than two live neighbours dies, as if caused by under-population.
  • 2. Any live cell with two or three live neighbours lives on to the next generation.
  • 3. Any live cell with more than three live neighbours dies, as if by over-population.
  • 4. Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.

I recently finished a project from Wickedly Smart, creator of books such as "Head First HTML5 Programming" and "Head First JavaScript", where I created a version of the Game of Life using HTML5, CSS3, and JavaScript. I have been making changes and experimenting with the application, changing the rate of reproduction time, as well as some of the initial states. You can view the code and see a working demo on my Codepen page.

Image of a JavaScript Countdown Timer application
Image of a JavaScript Countdown Timer application
Image of a JavaScript Countdown Timer application

What is especially interesting about these sorts of applications is that they mimic many situations found in the real world, as outlined by Complexity Science and Chaos Theory, such as the behavior of forest fires, virus transmission, and what causes ecological systems to rebalance themselves after a disaster such as an oil spill.