Snake · ling-2.6-1t
Output generated Cost / run $0.0052 Runtime 45.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.
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.
I'll create a complete Snake game in a single HTML file with all the requested features.
/tmp/ws/index.html (23954 bytes)Successfully wrote 23954 bytes to /tmp/ws/index.html
I've created a fully playable Snake game with all the requested features: **Features included:** - **Canvas-based rendering** with smooth visuals and particle effects - **Arrow-key controls** (also supports WASD) - prevent 180° turns - **Growing tail** - snake grows when it eats food - **Food system** - apple-shaped food with glow effects - **Score tracking** - +10 points per food, displayed in real-time - **High score persistence** - saved to localStorage - **Game over state** - triggered by wall or self-collision with explosion particles - **Restart functionality** - "Play Again" button - **Pause/Resume** - Spacebar or pause button - **Mobile touch controls** - swipe gestures on the canvas **Visual design:** - Dark gradient background with neon green snake and red food - Glowing effects, rounded corners, and particle explosions - Responsive layout that works on mobile devices - Grid background for better spatial awareness - Animated eyes on the snake head that follow direction **Game mechanics:** - Snake speeds up as it grows (slows down at minimum speed for playability) - Food never spawns on the snake - Session-best tracking during the current game - Smooth movement with buffered input to prevent missed turns