Game of Life

Conway's Game of Life implemented in Rust and WebAssembly. Watch patterns evolve and create your own cellular automata.

RustWebAssemblyCanvas API

Click cells to toggle them

Conway's Game of Life is a cellular automaton devised by mathematician John Conway. It's a zero-player game where the evolution is determined by its initial state.

The Rules

  1. Any live cell with 2 or 3 live neighbors survives
  2. Any dead cell with exactly 3 live neighbors becomes a live cell
  3. All other cells die or stay dead

How It Works

This implementation uses Rust compiled to WebAssembly for the game logic. The Rust code handles:

  • Grid state management
  • Neighbor counting with wraparound edges
  • State transitions each generation

The canvas rendering happens in JavaScript, receiving the cell data directly from WASM memory.

Try It

Click cells to toggle them, or use the randomize button to generate a random pattern. Press play to watch generations evolve.