A browser-based implementation of Conway's Game of Life — a zero-player cellular automaton where patterns evolve based on simple rules.
- Interactive grid — Click or drag to draw/erase cells, even while the simulation is running
- Adjustable speed — Control simulation FPS (1–60) with a slider
- Resizable grid — Change grid dimensions (30–150) on the fly
- Preset patterns — Glider, Gosper Gun, Pulsar, and Random fill
- Step mode — Advance one generation at a time
- Live stats — Generation counter and population tracker
- Keyboard shortcuts — Space (start/stop), N (next step), C (clear)
- Responsive design — Works on desktop and smaller screens
- Zero dependencies — No external libraries required
- A living cell with fewer than 2 neighbors dies (solitude)
- A living cell with 2 or 3 neighbors survives
- A living cell with more than 3 neighbors dies (overpopulation)
- An empty cell with exactly 3 neighbors becomes alive
The grid wraps around (toroidal topology), so cells on edges connect to the opposite side.
Open GameOfLife.html in any modern browser. No build step or server needed.
| Action | Mouse/UI | Keyboard |
|---|---|---|
| Draw/erase cells | Click or drag on grid | — |
| Start simulation | Start button | Space |
| Stop simulation | Stop button | Space |
| Step forward | Step button | N |
| Clear grid | Clear button | C |
| Change speed | Speed slider | — |
| Change grid size | Grid Size slider | — |
| Load pattern | Pattern buttons | — |
├── GameOfLife.html Main page
├── css/
│ └── style.css Custom styles (dark theme, layout)
├── js/
│ └── game_of_life.js Game logic and rendering
└── README.md
MIT