oneshotlm
Compare all models on this prompt →

Snake · nex-n2-pro

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 · 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
We need respond by doing task. Need create index.html in cwd. Need inspect? Current directory /tmp/ws. Need build single page. No external. Need ensure playable Snake canvas arrow keys, growing tail, food, score, game-over restart. Need maybe include touch? User only arrow-key. Need write file. Need maybe use bash pwd? We know cwd. Need create file. Could use write. Need produce concise final. Need ensure file self-contained. Let's craft robust Snake game.

Need maybe include style tag, script tag. Need no external. Features:
- Canvas centered, high DPI scaling maybe.
- Grid 20x20, cell 24, canvas width 480 height 480.
- Snake array of segments, direction, pending direction.
- Food random not on snake.
- Score, best maybe localStorage? External? localStorage okay. But no network. Could include.
- Game states: running, over, maybe paused? Restart button.
- Arrow keys prevent scroll.
- Start maybe game starts immediately.
- On game over show overlay with restart button, Enter/Space.
- R restart.
- Use requestAnimationFrame with fixed tick 100ms.
- Canvas draw.
- Growing tail: only extend when eating.
- Edge collision or wrap? Need playable. We'll choose wall collision game over.
- Self collision.
- Food random.
- Score increments.
- Restart state.
- Need arrow-key controls. Prevent reverse direction if length >1.
- Could include "Click restart" and "Press R/Enter".

Need maybe if document hidden pause? Not necessary. But good.

Need write index.html. Need ensure no external.
write /tmp/ws/index.html (10127 bytes)
toolResult

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

assistant
thinking

Created `/tmp/ws/index.html` with a self-contained playable Snake game.

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

modelnex-n2-pro
vendorNex AGI
harnesspi-agent
generated2026-08-01

EVALUATION

2/5 partial

Snake starts on Enter/Space but arrow/WASD presses just crash it back to Game Over without visible movement.

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.4%
on wheel0.0%
on enter + space45.1%
on arrow keys0.0%
on w/a/s/d0.0%
frame spread12.4 / 255
console errors0
js errors none

METRICS

runtime25.4s
tokens in99
tokens out3.8k
cached7.0k
cost / run$0.0040