Snake · gpt-5.4-nano
Build a playable Snake game on a canvas with arrow-key controls, a growing tail, food, score, and a game-over and restart state.
transcript · 4 messages
Build a playable Snake game on a canvas with arrow-key controls, a growing tail, food, score, and a game-over and restart state.
thinking
**Planning a simple snake game** I'm thinking I need to create a single index.html file that includes all necessary CSS and JavaScript without relying on any external resources. I'll implement a grid system for the snake game using a canvas. It’ll use requestAnimationFrame or an interval for animation, and I'll incorporate arrow key controls while preventing the snake from reversing. Also, I want to include a restart option to ensure it's playable. Let's get started on writing this!
index.html (15139 bytes)Successfully wrote 15139 bytes to index.html
Created **`index.html`** with a fully playable **Snake** game on a canvas: - **Arrow-key controls** (can’t reverse direction) - **Growing tail** when eating food - **Food spawning** on empty tiles - **Score + length + speed** HUD - **Game-over screen** + **Restart** (also restart by pressing an arrow key) Open `index.html` in your browser to play.
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
EVALUATION
Snake game starts on arrow keys, shows snake, food, and a Game Over/Restart screen with score.
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.