Remix Library / Techy

Game of Life

Conway's famous simulation: four simple rules, and patterns that seem alive.

Intermediate HTML · CSS · JavaScript
No account needed: you’ll start as a guest.
read-only · remix to edit
Preview

What you'll learn

  • 2D arrays
  • Cellular automata
  • Counting neighbors
  • Wrap-around edges
  • Buttons & controls

Challenges

Remix it, then try these. Each one is a bit harder than the last.

  1. Draw a glider (5 cells) and watch it travel across the board.
  2. Show a generation counter and how many cells are alive.
  3. Color cells by how long they've been alive.
  4. Add a button that places a Gosper glider gun.
  5. Change the rules (e.g. born with 3 or 6 neighbors) and see what happens.