oneshotlm
Compare all models on this prompt →

Snake · qwen3.6-27b

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 ↗
transcript · 6 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
The user wants a self-contained Snake game in a single HTML file. Let me build a complete, playable Snake game with:
- Canvas-based rendering
- Arrow key controls
- Growing tail when eating food
- Score display
- Game over state (collision with walls or self)
- Restart functionality

Let me write this all in one index.html file with inline CSS and JS.
write /workspace/index.html (10348 bytes)
toolResult

Successfully wrote 10348 bytes to /workspace/index.html

assistant
thinking
The file has been written. Let me verify it exists and is complete.

bash {"command":"head -5 /workspace/index.html && echo \"---\" && tail -5 /workspace/index.html && echo \"---\" && wc -l /workspace/index.html"}
toolResult

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> --- requestAnimationFrame(loop); })(); </script> </body> </html>--- 371 /workspace/index.html

assistant
thinking
The file is complete and valid. Let me summarize what was built.

Done. `/workspace/index.html` is a fully self-contained Snake game with: - **Canvas rendering** on a 30×25 grid with subtle grid lines and rounded rects - **Arrow-key controls** (also supports WASD) - **Growing tail** — the snake lengthens each time food is eaten - **Food** — randomly placed with a glow effect, never spawns on the snake - **Score + Best** — live score counter; best score persisted in `localStorage` - **Speed ramp** — game gets slightly faster every 5 points - **Game over** — on wall or self-collision, with an overlay showing final score - **Restart** — press Enter/Space/tap after game over to replay - **Touch/swipe support** — swipe on the canvas to steer on mobile - **Visual polish** — gradient snake body, glowing head with eyes, neon green-on-dark aesthetic

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.6-27b
vendorQwen
harnesspi-agent
generated2026-07-31

EVALUATION

3/5 working

Snake game responds to arrow keys with movement and game-over/restart state, but instantly hits wall causing quick game over.

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.

idle motion0.0%
on click0.0%
on drag0.0%
on wheel0.0%
on enter + space0.0%
on arrow keys1.5%
on w/a/s/d0.5%
frame spread9.4 / 255
console errors0
js errors none

METRICS

runtime77.2s
tokens in7.7k
tokens out4.0k
cached4.4k
cost / run$0.0149