oneshotlm
Compare all models on this prompt →

Conway's Game of Life · glm-5.2

Output generated Cost / run $0.0152 Runtime 91.8s

Prompt for this run

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.

⛨ sandboxed Open in new tab ↗

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

modelglm-5.2
vendorZ.ai · GLM
harnesspi-agent
generated2026-07-08

METRICS

runtime91.8s
tokens in6.4k
tokens out3.7k
cached2.8k
cost / run$0.0152
Transcript · 4 messages
user

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.

assistant
thinking
Let me create a Conway's Game of Life web app in a single index.html file.
→ write /workspace/index.html (11135 bytes)
toolResult

Successfully wrote 11135 bytes to /workspace/index.html

assistant

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.