oneshotlm
Compare all models on this prompt →

Snake · gpt-5.4-nano

Output generated Cost / run $0.0086 Runtime 54.3s

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

modelgpt-5.4-nano
vendorOpenAI
harnesspi-agent
generated2026-07-22

METRICS

runtime54.3s
tokens in7.2k
tokens out5.8k
cached0
cost / run$0.0086
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
**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!
→ write index.html (15139 bytes)
toolResult

Successfully wrote 15139 bytes to index.html

assistant

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.