Conway's Game of Life · glm-5.2
Run Conway's Game of Life on a full-screen canvas grid with click-and-drag to toggle cells, plus play/pause, step, randomize, and clear controls.
transcript · 4 messages
Run Conway's Game of Life on a full-screen canvas grid with click-and-drag to toggle cells, plus play/pause, step, randomize, and clear controls.
thinking
Let me create a Conway's Game of Life web app in a single index.html file.
/workspace/index.html (11135 bytes)Successfully wrote 11135 bytes to /workspace/index.html
Done. I created `/workspace/index.html` — a fully self-contained Conway's Game of Life app. **Features:** - **Full-screen canvas grid** that auto-resizes to the viewport (device-pixel-ratio aware for crisp rendering) - **Click-and-drag to toggle cells** — click flips the clicked cell, and dragging paints that same value (so you can draw/erase strokes naturally) - **Play/Pause** button (also `Space`) - **Step** button advances one generation (also `S`) - **Randomize** fills ~30% density (also `R`) - **Clear** empties the board (also `C`) - **Speed slider** (1–60 generations/sec) - Live stats (generation count + live cell count) and toroidal wrapping at edges **Implementation notes:** - Grid stored in a `Uint8Array`; the next generation is computed into a scratch buffer and swapped (no allocation per step), with an unrolled neighbor count and modulo wrap. - Resizing preserves the overlapping region of the existing pattern. - Seeded with two gliders so the canvas isn't empty on load. Open `index.html` in a browser to run it — no network or external resources needed.
TAKE IT TO CODE
A single self-contained HTML file — copy it and open in any browser, or reuse the prompt with your own pi-agent run.
RUN
EVALUATION
Game of Life renders with glider pattern, drag draws cells, play/pause toggles via space, but grid is sparse and mostly empty.
Vision grade · anthropic/claude-sonnet-5
MEASUREMENTS
Raw readings from the capture, not a verdict — the grade above is the only judgement. Percentages are how much of the screen changed; the measure under-reports sparse motion on a dark background.