Conway's Game of Life

Written 09:04 am 7/4/2012 Modifed 06:57 pm 7/18/2012

Conway's Game of Life is a very basic artificial life simulator. It arranges a grid of dead or alive cells, and for each generation, applies a set of rules to determine if the cell will be dead or alive.

The rules are as follows:

  1. If the cell is alive and has more than three neighbors, it dies from overcrowding.
  2. If the cell is alive and has less than two neighbors, it dies from loneliness.
  3. If the cell is dead, but has three living neighbors, it becomes alive.
  4. All other cells retain their state.

This specific implementation treats the board as a toroid. That means that the board can be thought of as extending from the bottom to the top, and from left to the right (and vice versa)- think pacman.

I have the board colorized so that any dead cells with three neighbors are tinted light blue, any alive cells with two or three neighbors are blue, any other alive cells are dark gray, and any other dead cells are pure white. The darkness of the border reflects how many neighbors the cell has.

To change the cell state, click on it.