Click cells to toggle them, or choose a preset pattern above.
// THE FOUR RULES
1. A live cell with <2 neighbours dies — underpopulation
2. A live cell with 2–3 neighbours survives
3. A live cell with >3 neighbours dies — overpopulation
4. A dead cell with exactly 3 neighbours is born — reproduction
// WHY SERVER-SIDE?
Each [STEP] sends a POST request to the Rails server. The rules above are applied in pure Ruby, and the response is a Turbo Stream — a tiny HTML fragment that surgically replaces just the grid and stats bar, with no full page reload.
This makes the server's computation visible: watch the REQ counter tick up and the ms timer show exactly how long each generation took to compute.