Instructions:

  • Click a cell in the table to toggle it alive or dead (black is alive).
  • You can also click and drag to "paint" living cells quickly.
  • Click the Play button to run the simulation at the speed set in the Time Step input.
  • Click the Pause button to stop the simulation.
  • Click the Step Forward button while paused to advance one frame of the simulation.
  • Click the Clear button to kill all cells.
  • Click the Randomize button to randomly select living cells based on the Randomize Density (the likelihood for a given cell to come to life).

About:

Conway's Game of Life was created by John Conway in 1970. It's a cellular automaton defined by a set of very simple rules from which chaotic and complex structures can emerge. More details about Conway's Game of Life can be found on Wikipedia .

The rules can be stated simply as the following, where a neighbor is defined as an adjacent cell in vertical, horizontal, and diagonal directions.

  • A living cell with two or three living neighbors survives.
  • A dead cell comes to life when there are exactly three living neighbors.
  • A living cell dies if there are more than three or fewer than two living neighbors.

I wrote this implementation of Conway's Game Of Life just for fun. My goal was to write it in pure HTML and vanilla Javascript and to keep it minimal. Bugs can be reported by opening an issue.

The source code can be found on GitHub.