oneshotlm
Compare all models on this prompt →

Snake · qwen3-coder

Output generated Cost / run $0.0029 Runtime 61.5s

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.

⛨ sandboxed Open in new tab ↗

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

modelqwen3-coder
vendorQwen
harnesspi-agent
generated2026-08-01

METRICS

runtime61.5s
tokens in5.3k
tokens out2.1k
cached4.1k
cost / run$0.0029
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

I'll create a complete Snake game in a single HTML file with all the features you requested. Let me build this step by step.

→ write index.html (8567 bytes)
toolResult

Successfully wrote 8567 bytes to index.html

assistant

I've created a complete Snake game in a single HTML file with all the features you requested: 1. Canvas-based game with a grid layout 2. Arrow-key controls for movement 3. Snake that grows when it eats food 4. Score tracking system 5. Game over detection (hitting walls or self) 6. Restart functionality 7. Visual styling with a clean interface The game features: - A green snake that moves around the board - Red food that appears randomly - Score counter that increases by 10 points per food item - Game over screen with final score and restart button - Instructions for the player To play: 1. Use the arrow keys (↑, ↓, ←, →) to control the snake's direction 2. Try to eat the red food to grow and increase your score 3. Avoid hitting the walls or the snake's own body 4. When game over, click "Play Again" to restart The game is completely self-contained in one file with no external dependencies. All CSS is in a style tag and JavaScript is in a script tag as requested.