Conway's Game of Life

Implement Conway's Game of Life — a cellular automaton where cells live, die, or reproduce based on simple rules, creating complex emergent patterns.

Overview

Build an interactive grid simulation where each cell follows four rules based on its neighbors. Despite the simplicity, this produces fascinating emergent behavior — gliders, oscillators, and still lifes. It is a classic CS project that demonstrates state management, grid computation, and animation loops.

Conway's Game of Life is a zero-player game invented by mathematician John Conway in 1970. The simulation runs on a grid of cells, each either alive or dead. Four simple rules determine the next generation: underpopulation kills cells with fewer than two neighbors, survival keeps cells with two or three neighbors alive, overpopulation kills cells with more than three neighbors, and reproduction brings dead cells with exactly three neighbors to life. From these four rules alone, astonishingly complex patterns emerge.

Building this project teaches you fundamental concepts that transfer to many domains: cellular automata, double-buffering for simultaneous state updates, Canvas rendering for performance, and interactive grid UIs. The implementation is deceptively simple at first but reveals subtle challenges around boundary handling, performance at scale, and state management correctness.

For interviews, this project is a classic. It appears frequently as a take-home coding challenge, and building it proactively shows initiative. You can discuss Turing completeness, emergent complexity, optimization strategies like Hashlife, and practical engineering decisions like choosing Uint8Array over boolean arrays for performance.

Interview questions

  • What are the four rules?
  • How do I handle grid boundaries?
  • How do I make the simulation performant?
  • What features make this stand out?
  • Why is double-buffering mandatory?
  • What is the significance of Conway's Game of Life being Turing complete?

Sign up free to read the full topic

More Projects topics

Start free on Cariara · Coding problems · System design studio