oneshotlm
Compare all models on this prompt →

Snake · hy3-preview

Output generated Cost / run $0.0009 Runtime 31.4s

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

modelhy3-preview
vendorTencent · Hunyuan
harnesspi-agent
generated2026-07-22

METRICS

runtime31.4s
tokens in6.0k
tokens out3.3k
cached2.9k
cost / run$0.0009
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 as a single self-contained HTML file with all the requested features.

→ write /workspace/index.html (9001 bytes)
toolResult

Successfully wrote 9001 bytes to /workspace/index.html

assistant

The Snake game has been built and saved to `index.html`. Here's what's included: **Features:** - **Canvas-based gameplay** with a 400x400 pixel play area - **Arrow key controls** (also supports WASD) - **Growing tail** - snake grows when eating food - **Food spawning** with collision detection to avoid spawning on the snake - **Score tracking** with points for each food eaten - **High score** saved to localStorage - **Game over screen** with final score display - **Restart button** to play again **Visual Details:** - Neon green snake with gradient body and eyes on the head - Red glowing food with pulsing animation - Dark background with subtle grid lines - Snake eyes that change direction based on movement - Increasing speed as score goes up (every 50 points) **Game Mechanics:** - Snake cannot reverse direction (prevents instant death) - Wall and self-collision end the game - Speed increases gradually to increase difficulty Open `index.html` in a browser to play!