oneshotlm
Compare all models on this prompt →

Snake · gpt-5.6-luna

Output generated Cost / run $0.0103 Runtime 20.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.

⛨ 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.6-luna
vendorOpenAI
harnesspi-agent
generated2026-08-01

METRICS

runtime20.9s
tokens in6.2k
tokens out2.8k
cached3.5k
cost / run$0.0103
Transcript · 6 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
**Creating index file**

I need to create an `index.html` file. It’s essential to make sure I inspect the directory properly to set everything up correctly. I want to confirm that I’m organizing things in a logical way. This way, when I put everything together, it’ll be easier to navigate. Let’s make sure I’m on the right track before diving into the coding part! It'll set a solid foundation for what I'm building.
→ bash {"command":"pwd && ls -la"}
toolResult

/tmp/ws total 0 drwxr-sr-x. 2 node node 6 Aug 1 17:57 . drwxrwsrwx. 3 root node 16 Aug 1 17:57 ..

assistant
thinking
**Creating a game index**

I need to create an index for the game, ensuring it's polished and operates as a single file. Maybe I don't need to inspect too much; instead, I can focus on writing it. I want to make sure the arrow keys are playable and that there’s an option to restart. The canvas should be responsive while maintaining the grid layout. I’ll consider using canvas rendering for the game loop, controls, and storing high scores in localStorage. Accessibility is also important, so I’ll keep that in mind while writing.
→ write /tmp/ws/index.html (7633 bytes)
toolResult

Successfully wrote 7633 bytes to /tmp/ws/index.html

assistant

Created `/tmp/ws/index.html` with a fully self-contained playable Snake game featuring: - Canvas-based gameplay - Arrow-key controls - Growing snake tail - Food and score tracking - Persistent best score - Collision detection - Game-over overlay - Restart button and `R` shortcut - Responsive styling - No external resources or network requests