Game of LifeBeta
Draw cells, swap rules and explore Conway's Game of Life
This tool is a beta version still being stabilized. Please let us know if a result looks off.
Drag on the canvas to draw cells (right button = eraser). Pick a pattern to stamp it where you click, and press R or Rotate to turn it. The rule B3/S23 means “born with 3 neighbors, survives with 2 or 3”. Change the rule and the same shapes grow into completely different worlds. Shortcuts: Space play/pause, N step.
With Wrap edges on (the default) the grid joins up like a doughnut, so a glider that leaves one side comes back on the other and crashes. On the default 256×172 grid the glider gun is wrecked by its own gliders after about 2,300 generations, and the R-pentomino reaches 116 cells at generation 1103 but then shrinks as returning gliders hit its debris. Turn it off and the outside becomes a wall of dead cells: gliders freeze into blocks at the edge and the gun keeps firing (the R-pentomino ends at 110 cells instead). Known figures from the infinite plane (acorn: 633 cells at generation 5206) don't come out exactly either way.
Working…
0.0
It hasn't frozen — the result will appear when the calculation finishes.
About Game of Life
This tool runs a Life-like cellular automaton on a 256×172 grid (other sizes are selectable). Each cell is alive or dead, and its next state depends only on how many of its eight neighbours are alive. The default rule B3/S23 reads: a dead cell is Born with exactly 3 live neighbours, and a live cell Survives with 2 or 3. Every cell updates at once, so the engine reads the whole current generation and writes the next one into a separate buffer before swapping.
On load about 25% of cells are switched on at random. With “Wrap edges” on, the grid is a torus: a glider leaving the right edge comes back on the left. With it off, everything outside the grid counts as dead. Light blue marks newborn cells, violet marks cells that have lived a while, and the fading trail shows where cells recently died.
Running B3/S23 by hand for one generation
Take a blinker: three live cells in a horizontal row. The middle cell has 2 neighbours and survives. The two end cells have 1 neighbour each and die. The empty cells directly above and below the middle each touch all three live cells, so they have 3 neighbours and are born. The row has become a column, and one generation later it turns back. That is a period-2 oscillator.
A 2×2 block is the simplest still life. Each of its cells has exactly 3 live neighbours, so all survive, and no empty cell around it reaches 3, so nothing is born. When a random soup settles after a few hundred generations into scattered blocks, beehives and blinkers, you are looking at the small set of shapes that satisfy the rule exactly.
Experiment 1: the glider and the doughnut
Clear the grid, stamp one glider and press N to advance a generation at a time. Every 4 generations the glider returns to its original shape shifted one cell diagonally. Life enthusiasts call that speed c/4, where c is one cell per generation, the fastest anything can possibly travel under this rule.
On the default 256×172 wrapped grid the glider laps the width every 1,024 generations and the height every 688. To come back to exactly where it started it needs a whole number of laps in both directions: the least common multiple of 256 and 172 is 11,008 cells, which takes 44,032 generations. Switch wrapping off and the glider instead hits the wall and breaks into a small piece of debris.
Experiment 2: why the glider gun eventually destroys itself
The “Glider gun” pattern is the Gosper glider gun, found by Bill Gosper in 1970. It emits one glider every 30 generations. Because gliders move one cell per 4 generations, consecutive gliders in the stream are 7.5 cells apart along the diagonal. Conway had conjectured that no finite pattern could grow forever and had offered a prize for a counterexample; the gun settled it.
Leave the gun running on a wrapped grid and it will not last. The grid is a finite torus, so the gliders it fires come around and crash into the gun or into the stream behind them. Unbounded growth is a property of the infinite plane, not of any screen. With walls, gliders shatter at the edge instead; stamp the gun so that the debris lands away from it and it keeps firing much longer.
Experiment 3: a five-cell seed that takes 1,103 generations to settle
The R-pentomino has only five cells, yet on an unbounded plane it churns for 1,103 generations before stabilising with 116 cells and six gliders flying away. The acorn, seven cells, runs for 5,206 generations and ends with 633 cells. Do not expect those exact totals here. On a finite grid the escaping gliders wrap round and hit the debris, restarting activity. Pick the largest grid and stamp the pattern in the middle and the first few hundred generations follow the published history closely. Stamped in the middle of the default 256×172 grid with wrapping on, the R-pentomino does reach 116 cells at generation 1,103, but returning gliders then hit its debris and it is down to 94 cells by generation 5,000; with wrapping off its six gliders freeze into blocks at the wall and it stops at 110. The acorn has 439 cells at generation 5,206 with wrapping on and 493 with it off.
What changes when you change the rule
The engine stores B and S as bitmasks over neighbour counts 0 to 8, so any combination runs. The presets were chosen because each produces a recognisably different world from the same random start.
- HighLife B36/S23 adds a single birth condition, 6 neighbours, to Life. That small change allows a pattern that copies itself, known as the replicator.
- Seeds B2/S has an empty survival list, so every cell lives exactly one generation. The pattern still explodes, because birth on 2 neighbours is so easy.
- Day & Night B3678/S34678 is symmetric under swapping live and dead: a white island in a black sea behaves exactly like a black island in a white sea.
- Maze B3/S12345 makes cells very hard to kill, so growth freezes into corridor-like walls.
- Coral B3/S45678 grows dense blobs that creep slowly outwards.
Worked examples
One generation of a blinker
- Input
B3/S23, horizontal row at (0,0), (1,0), (2,0)- Output
Vertical column at (1,-1), (1,0), (1,1)
Ends have 1 neighbour and die; the centre has 2 and survives; (1,-1) and (1,1) have 3 and are born.
When a glider returns to its starting cell
- Input
256×172 grid, wrap on, one glider- Output
44,032 generations
One cell per 4 generations; lcm(256, 172) = 11,008 cells; × 4 = 44,032.
Spacing of the Gosper gun's stream
- Input
Gosper glider gun- Output
One glider per 30 generations, 7.5 cells apart
Period 30 divided by speed (1 cell per 4 generations) = 7.5 cells.
How to use it
- Pick a named rule or type one in B3/S23 form (S23/B3 and 23/3 are accepted too).
- Drag to draw cells, or pick a pattern and click to stamp it; R rotates it.
- Space plays or pauses, N advances one generation.
- Toggle “Wrap edges” and rerun the same pattern to see the boundary's effect.
Frequently asked questions
Who invented the Game of Life?
The mathematician John Horton Conway. It reached the public through Martin Gardner's “Mathematical Games” column in the October 1970 issue of Scientific American.
What does it mean that Life is Turing complete?
Gliders can act as signals, and guns plus carefully timed collisions can act as logic gates and memory, so in principle any computation can be built. Berlekamp, Conway and Guy sketched the construction in Winning Ways; later builders made working Turing machines. Such machines need far more room than this tool's maximum 1,024-cell side.
Why does a random start always seem to die down?
Most random soups decay into still lifes and small oscillators. On a torus any wandering glider eventually hits something, so a quiet, blinking end state is the usual outcome.
Is the result wrong when wrapping is off?
No, it is a different boundary condition. Life is defined on an infinite plane, so both modes are approximations: walls treat outside cells as dead, wrapping treats the opposite edge as the neighbour.
Notes
The grid side is capped at 1,024 cells. Lifespans and final populations quoted for an infinite plane can differ on a finite grid.
Related guides
Sources
- M. Gardner, Mathematical Games: The fantastic combinations of John Conway's new solitaire game “life”, Scientific American 223(4), 120–123 (October 1970)
- LifeWiki — Gosper glider gun
- LifeWiki — R-pentomino
- LifeWiki — Acorn
- LifeWiki — HighLife (B36/S23) and its replicator
Last reviewed: