oneshotlm
Compare all models on this prompt →

Snake · claude-opus-4.8

Output generated Cost / run $0.0859 Runtime 30.5s

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

modelclaude-opus-4.8
vendorAnthropic · Claude
harnesspi-agent
generated2026-07-08

METRICS

runtime30.5s
tokens in7.2k
tokens out2.8k
cached4.5k
cost / run$0.0859
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
I'm going to build a complete Snake game as a single HTML file.
→ write index.html (5367 bytes)
toolResult

Successfully wrote 5367 bytes to index.html

assistant

Created `index.html` — a complete, self-contained Snake game. Features: - **Canvas rendering** with rounded snake segments and food - **Arrow keys + WASD** controls, with reversal protection - **Growing tail** — snake extends each time food is eaten - **Score + persistent best** score display - **Game-over state** with wall/self collision detection - **Restart** via the "Play Again" button and start overlay - Fixed-timestep game loop for smooth, consistent speed Open it in any browser to play — no network or external resources needed.