Conway's Game of Life

Cellular automaton with pattern library and custom rule support

experimentcellular-automatasimulationemergence

Controls

Generation: 0

Presets

Conway's Game of Life demonstrates emergent complexity from simple rules:

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

Patterns

Implemented classic patterns: gliders, oscillators, still lifes, and spaceships.

function evolve(grid: boolean[][]): boolean[][] {
  const next = createEmptyGrid();
  for (let i = 0; i < grid.length; i++) {
    for (let j = 0; j < grid[0].length; j++) {
      const neighbors = countNeighbors(grid, i, j);
      next[i][j] = neighbors === 3 || (grid[i][j] && neighbors === 2);
    }
  }
  return next;
}