oneshotlm
Compare all models on this prompt →

Snake · gemma-4-26b-a4b-it

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
The user wants a playable Snake game in a single `index.html` file.
The game needs:
- Canvas-based rendering.
- Arrow-key controls.
- A growing tail.
- Food.
- Score tracking.
- Game-over and restart state.
- No external resources (pure HTML/CSS/JS).

Plan:
1.  Create an `index.html` file.
2.  Add a `<canvas>` element.
3.  Add CSS for styling (centering the canvas, basic game UI).
4.  Add JavaScript for:
    - Game loop (using `requestAnimationFrame` or `setTimeout`).
    - Snake movement and growth.
    - Food generation.
    - Collision detection (walls and self).
    - Score management.
    - Keyboard input handling.
    - Game state management (playing, game over).

Implementation details:
- Grid-based movement.
- Snake as an array of coordinates.
- Food as a single coordinate.
- Canvas size should be fixed (e.g., 400x400).
- Cell size (e.g., 20px).

Let's write the code.
write index.html (7657 bytes)
toolResult

Successfully wrote 7657 bytes to index.html

assistant

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

modelgemma-4-26b-a4b-it
vendorGoogle
harnesspi-agent
generated2026-07-22

EVALUATION

1/5 broken

Game shows Game Over immediately with score 0 and never responds to any input, including restart clicks.

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 keys0.0%
on w/a/s/d0.0%
frame spread22.3 / 255
console errors0
js errors none

METRICS

runtime37.9s
tokens in1.4k
tokens out2.4k
cached0
cost / run$0.0009