Mercyhurst UniversityMath DeptDr Williams Home

Game of Life


Grid Size:
Life:    New Life:    Dead:    Grid:

About Cellular Automata

A cellular automaton is a grid of cells, each of which has a finite number of states. The game of life is an example of a cellular automaton originally devised by John H. Conway in 1970. In all variations of the game of life, each cell is either on or off ('alive' or 'dead'), and can change state according to a particular set of rules. In the original game of life, the rules are: Other variations have since been developed. One of the more important of these is HighLife, which follows the first two rules of Conway's version. However, a cell may come to life if it has either 3 or 6 living neighbors. Each variation can be denoted by A/B, where A is a string of numbers of neighboring cells required to keep a cell alive, and B is a string of numbers of neighboring cells required to bring a cell to life. For instance, Conway's Game of Life would be denoted 23/3, while HighLife would be 23/36.

Using the Applet

Draw on the grid to add cells, or choose a starting pattern from the menu. Click the 'Start Life' button to begin game, 'Pause Life' to stop it, and 'One Generation' to proceed one step at a time. Some common variations are available in the menu, or you can enter your own rule. Typing, for example, 124/56 in the 'Custom Rule' input box will produce a variation that keeps a cell alive if it has 1, 2, or 4 neighbors, and brings a cell to life if it has 5 or 6 neighbors.

It is important to note that the game is intended to be played on an infinite grid. A finite version, like this applet, has some limitations near the edges. One method for addressing this problem is to 'wrap' the edges, so that a cell on the top row has neighbors on the bottom row, and a cell on the left edge has neighbors on the right. The corner cells have neighbors at each corner. That is, wrapping turns the grid into a torus. Another way of dealing with the finite issue is to assume that all cells outside of the grid are dead. Unchecking the 'Wrap' option in the menu will make use of this method. Neither approach is perfect - assuming the border is dead causes a distortion near the edges, and wrapping may cause unintended collisions.

There are many known starting configurations that produce various effects. The Replicator will evolve into a blinking pattern under the 23/3 rule, but will repeatedly copy itself along a diagonal line under the 23/36 rule. The other starting patterns are best viewed with the 23/3, in a larger grid. Unfortunately, many of the regenerating or spawning properties are lost, due to the finite edge problem. For the Glider Gun, try turning off the wrap option. (Historical note: Conway originally believed that no starting pattern in the 23/3 rule could produce an infinite number of cells, and offered $50 to anyone that could disprove this assumption. Bill Gosper found this one within the year, and others have been found since. It is, to date, the smallest known glider gun.)

When using a larger grid size, like 50x80 or 75x120, the speed of the game may be slower than expected. Consider using a smaller grid, or increasing the time of each iteration.

About this Applet

This applet was created using JavaScript and the Raphael library. If you are unable to see the applet, make sure you have JavaScript enabled in your browser. This applet may not be supported by older browsers.