oneshotlm
Compare all models on this prompt →

Snake · qwen3.8-2.4t-a95b

Output generated Cost / run $0.0336 Runtime 44.4s

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

modelqwen3.8-2.4t-a95b
vendorQwen
harnesspi-agent
generated2026-08-13

METRICS

runtime44.4s
tokens in6.5k
tokens out3.4k
cached0
cost / run$0.0336
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
Build a snake game in a single index.html.
→ write /tmp/ws/index.html (8416 bytes)
toolResult

Successfully wrote 8416 bytes to /tmp/ws/index.html

assistant
thinking
I need to look into this in more detail. Let me check the details.

Quick sanity check — the KEYS lowercase lookup: `KEYS[e.key.toLowerCase()]` — for example, if e.key is 'W' (uppercase W), it becomes 'w'. No problem. Done.

Done — `/tmp/ws/index.html` is a fully self-contained Snake game (no external resources). Features: - **Canvas board** (24×24 grid) with a checkerboard background and rounded, gradient-fading snake segments with eyes that face the direction of travel - **Arrow keys + WASD** controls, with 180°-reversal prevention - **Growing tail & food**: eating the pulsing red food grows the snake, adds 10 points, and slightly speeds up the game - **Score + best score** HUD (best tracks across rounds within the session) - **Game over & restart**: collision with walls or yourself shows an overlay with your final score; restart via button or **Space** - Smooth `requestAnimationFrame` loop with a fixed-timestep tick for consistent snake speed