Lesson goal: Conway's Game of Life & Emergence

Previous: Projectile motion and trajectory | Home | Next: Wolfram's Rule 30 and chaos

In 1970, British mathematician John Horton Conway invented a zero-player mathematical game that stunned the world: The Game of Life.

Life takes place on a two-dimensional grid of cells, each of which is either alive or dead. Every cell interacts with its $8$ immediate neighbors (horizontally, vertically, and diagonally).

At each time step, all cells transition simultaneously according to four simple rules:
  1. Underpopulation: Any live cell with fewer than $2$ live neighbors dies (as if by underpopulation).
  2. Survival: Any live cell with $2$ or $3$ live neighbors lives on to the next generation.
  3. Overpopulation: Any live cell with more than $3$ live neighbors dies (as if by overcrowding).
  4. Reproduction: Any dead cell with exactly $3$ live neighbors becomes a live cell!

The Wonder of Emergent Complexity

From these elementary rules arises astonishing mathematical behavior:
  • Still Lifes: Stable configurations that never change (e.g. Block, Beehive).
  • Oscillators: Patterns that repeat in a rhythmic cycle (e.g. Blinker, Beacon, Pulsar).
  • Spaceships: Self-propelling entities that travel across the grid forever (e.g. the Glider)!
Mathematicians have even proven that Conway's Game of Life is Turing Complete — you can build logic gates, binary counters, and simulate an entire computer inside it!
ca_grid(64, 40, 10, "conway", "#38bdf8")
ca_pattern("glider", 5, 5)

ca_pattern("pulsar", 26, 14)

ca_run()
Move the mouse over a dotted box for more information.

  • Interactive Drawing: You can click and drag with your mouse directly on the grid to create or erase living cells while the simulation is running!
  • Toolbar Controls: Use the Play/Pause, Step, and Clear buttons above the canvas to control time.
  • Toroidal Universe: The edges of the grid wrap around seamlessly (top connects to bottom, left connects to right).

Now you try. Run the simulation, then draw a 3x3 square of live cells with your mouse and watch what happens!

Type your code here:


See your results here: