Snake · mistral-medium-3.1
Output generated Cost / run $0.0040 Runtime 15.9s
Prompt for this run
Build a playable Snake game on a canvas with arrow-key controls, a growing tail, food, score, and a game-over and restart state.
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
METRICS
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.
index.html (6518 bytes)Successfully wrote 6518 bytes to index.html
I've created a self-contained Snake game in a single `index.html` file. The game includes: 1. A 20x20 grid canvas where the snake moves 2. Arrow key controls for direction 3. A growing tail when the snake eats food 4. Randomly placed food 5. Score tracking 6. Game over detection (wall collision or self-collision) 7. Game over screen with final score 8. Restart button You can open this file in any modern browser to play the game. The game runs at about 10 frames per second, and the snake speeds up slightly as it grows longer. The file is completely self-contained with no external dependencies - all CSS and JavaScript are included in the HTML file.