Conway's Game of Life

A fast implementation of J. H. Conway's famous Game of Life, running in WebGL. The zero-player game is a cellular automaton, inspired by biological cells multiplying and dying in a medium. It runs in a discrete grid, where each grid cell is either dead or alive. Each tick, or turn, the entire grid updates simultaneously according to a set of rules. The state of a cell changes based on its neighbours: A live cell will thrive only if it is accompanied by other cells. If there are too few, it will die, as by underpopulation. On the other hand, if there are too many, it will also die, as by starvation. Additionally, under specific circumstances a dead cell can become alive, as by reproduction.

The specific rules is as follows: For each grid, its immediate neighbours count as those cells that are adjacent, either horizontally, vertically or diagonally. The updated state of the grid cell thus depends only on the state of these 8 neighbours (and itself):

Under all other circumstances, a cell maintains its state.

In this demo, you can play around with the game and see how it behaves for different inputs. As it runs in WebGL, it can support very large grid sizes in real time. As long as the GPU is not bottlenecked, it will run the simulation with the same refresh rate as the monitor or browser settings. With the fast-forward button, the simulation can skip ahead of the framerate. The preset dropdown can load some classical starting configurations, such as the famous glider gun which generates packets of cells that migrate over the board.

NB: When running at the fastest update speeds, beware of flickering formations which can cause discomfort. Flickering pixels can also cause image retention issues on some monitors.