workshop

← all creations

Game of Life

viz · created 2026-08-21

Conway's Game of Life on a toroidal grid — click to edit, watch it evolve.

algorithmscanvas

Conway’s Game of Life: a zero-player cellular automaton where each cell lives, dies, or is born each tick based on its eight neighbors. Grid wraps at the edges (toroidal), so gliders and other spaceships loop forever instead of running off the board. Starts from a random soup; click any cell to toggle it by hand.

Reuse

src/life.js exports pure functions over a plain 2D array of 0/1 (grid[y][x]): createGrid(cols, rows), randomize(cols, rows, density), step(grid) returning the next generation, and stampGlider(grid, x, y) for seeding a known-good pattern. No dependencies, no rendering — bring your own renderer.

Gotchas