Mansori

The Game of Life: Simple Rules, Complex Worlds

About this lesson, for parents and teachers

Four rules. No player, no goal, no plan. Yet out of them come blinking lights, little ships that sail across the world, and explosions of life. Draw a few cells and see what they become.

Ages 12–14 · about 8 minutes · builds on If/Else: Run the Traffic Lights

Try this

  1. Drag on the grid to draw live cells, then press Play. Drag over live cells to erase them.
  2. Goal 1: make an oscillator. Three cells in a row is a good start.
  3. Goal 2: make a spaceship, a shape that moves by itself. Stamp a Glider if you need one.
  4. Goal 3: start with 6 cells or fewer and grow past 40 live cells. Watch the code count births and deaths.

How it works

The Game of Life was invented by mathematician John Conway in 1970. It is a cellular automaton: a grid of cells, each either alive or dead, that updates in steps called generations. Every cell looks at its 8 neighbours and follows the same rules. There is no other input. You only choose the starting pattern.

The rules: a live cell with fewer than 2 live neighbours dies (loneliness). A live cell with more than 3 dies (overcrowding). A live cell with 2 or 3 survives. A dead cell with exactly 3 live neighbours is born. Programmers write this as B3/S23: born on 3, survive on 2 or 3. Our world wraps around, so the left edge touches the right edge.

One important detail: every cell must be updated at the same time. The code counts neighbours in the current generation and writes the results into a separate new grid, then swaps. If you updated cells one by one in place, early changes would mess up the counts for later cells. This trick is called double buffering.

From these rules come patterns nobody designed. Still lifes like a 2x2 block never change. Oscillators like the blinker repeat. Spaceships like the glider move one cell diagonally every 4 generations. The 5-cell R-pentomino grows wildly. Complex behaviour arising from simple local rules is called emergence, and it shows up in bird flocks, ant colonies and even brains.

Where engineers use this

Cellular automata are used to model forest fires, traffic jams, crystal growth and the spread of diseases, and in video games to generate caves and terrain. The Game of Life is even Turing complete: it can simulate any computer.

Words to know

Cellular automaton
A grid of cells that all update in steps using the same simple rule based on their neighbours.
Generation
One step of the simulation, where every cell updates at once.
Oscillator
A pattern that returns to the same shape after a fixed number of generations.
Emergence
Complex behaviour that appears from many simple parts following simple rules.

Talk about it

Goal: Draw cells, press play, and watch four simple rules create gliders, oscillators and chaos.

  • Nobody programmed the glider to move. So why does it?
  • Can you think of something in nature where simple individual rules create a big pattern?
  • Why do all cells need to update at the same time?

Without a screen: Draw a 10x10 grid on graph paper, colour in a blinker or glider, then work out the next generation by hand on a fresh grid using the four rules. Use coins or beans as cells to make it faster. After 4 generations, check whether your glider moved.

Curriculum links: CSTA K-12 2-AP-12 (nested loops and compound conditionals), 2-DA-09 (computational models), 3A-DA-12 (models of a phenomenon); NGSS crosscutting concept: patterns, systems and system models

Questions

What are the rules of Conway's Game of Life?
A live cell with 2 or 3 live neighbours survives, otherwise it dies. A dead cell with exactly 3 live neighbours becomes alive. Every cell updates at the same time, once per generation.

What is a glider in the Game of Life?
A glider is a 5-cell pattern that changes shape over 4 generations and ends up as the same shape moved one cell diagonally. It keeps travelling forever unless it hits something.

Why is the Game of Life important in computer science?
It shows that very simple rules can produce complex, unpredictable behaviour, and it is Turing complete, meaning it can in principle run any computer program. It is a classic example of emergence and simulation.