Snake · deepseek-v4-flash-0731
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 · 8 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.
/workspace/index.html (12134 bytes)Successfully wrote 12134 bytes to /workspace/index.html
thinking
Let me verify the file exists.
{"command":"ls -la /workspace/index.html && node -e \"const h=require('fs').readFileSync('/workspace/index.html','utf8'); console.log('bytes-rw-r--r-- 1 node node 12145 Aug 1 12:52 /workspace/index.html bytes 12134
thinking
Let me also do a quick sanity check on the JS by extracting and linting it minimally. Let me just verify the script parses by extracting.
The game is complete in a single self-contained `index.html`. Let me verify the JavaScript parses correctly:
{"command":"cd /workspace && node -e \"\nconst fs=require('fs');\nconst html=fs.readFileSync('index.html','utf8');\nconst m=html.match(/<scrJS parses OK CSS present: true external http refs: false
thinking
Everything checks out. No external references, no network requests. Let me give a brief summary.
Done. I built a complete, self-contained Snake game in a single file: `/workspace/index.html`. **Features:** - 🎮 Canvas-rendered game with a 20×20 grid, smooth rounded snake bodies, animated-style food, and directional eyes on the head - ⌨️ Arrow-key **and** WASD controls, with reverse-move protection and keyboard queueing - 🍎 Growing tail — the snake lengthens each time it eats food and the tail physically trails behind - 🏆 Score, persistent high score (localStorage), and speed that ramps up as you eat - 💀 Game over on wall or self collision, with a full-screen overlay showing the reason - 🔄 Restart via the Start button, Space key, or clicking the canvas - ⏸️ Space to pause/resume - 🌈 Modern dark theme, no external resources, no network requests — runs fully sandboxed Verified: JS parses cleanly, CSS is inlined, and there are zero external references. Just open `index.html` in a 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 starts via Enter/Space, snake moves and hits wall causing game over with restart button working.
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.