oneshotlm
Compare all models on this prompt →

Snake · glm-5.2

Output generated Cost / run $0.0120 Runtime 65.9s

Prompt for this run

Build a playable Snake game on a canvas with arrow-key controls, a growing tail, food, score, and a game-over and restart state.

⛨ 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

runtime65.9s
tokens in5.6k
tokens out2.9k
cached2.4k
cost / run$0.0120
Transcript · 4 messages
user

Build a playable Snake game on a canvas with arrow-key controls, a growing tail, food, score, and a game-over and restart state.

assistant
thinking
Let me build a self-contained Snake game in index.html.
→ write /workspace/index.html (8549 bytes)
toolResult

Successfully wrote 8549 bytes to /workspace/index.html

assistant

Done. `index.html` is a self-contained Snake game with everything inline (no external resources, no network). Features: - **Canvas grid** (20×20 cells) with rounded snake segments and a food apple - **Controls**: Arrow keys or WASD to steer, `P` to pause, plus swipe support for touch - **Growing tail**: each food eaten adds a segment (popped only when not eating) - **Score & best**: live HUD, best saved to `localStorage` - **Speed-up**: snake gets slightly faster as you score - **Game over**: wall or self collision shows an overlay with a **Restart** button; includes a paused state too Open `index.html` in any browser and hit Play.