Bouncing balls in a heptagon · qwen3-next-80b-a3b-instruct
Output generated Cost / run $0.0040 Runtime 22.9s
Prompt for this run
Show 20 numbered balls (1 to 20) dropping from the center of a heptagon that spins 360 degrees every 5 seconds. The balls are affected by gravity and friction, collide with each other, and bounce realistically off the rotating walls; show each ball's spin via the rotation of its number. Implement all collision detection yourself.
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
Show 20 numbered balls (1 to 20) dropping from the center of a heptagon that spins 360 degrees every 5 seconds. The balls are affected by gravity and friction, collide with each other, and bounce realistically off the rotating walls; show each ball's spin via the rotation of its number. Implement all collision detection yourself.
I'll create a single-page web app with 20 numbered balls dropping from the center of a spinning heptagon, with realistic physics including gravity, friction, collisions, and rotation.
index.html (11965 bytes)Successfully wrote 11965 bytes to index.html
I've created a single-page web app with 20 numbered balls dropping from the center of a spinning heptagon. The implementation includes: - A heptagon that rotates 360 degrees every 5 seconds - 20 balls with different colors and numbers (1-20) that start from the center - Realistic physics with gravity, friction, and restitution - Ball-to-ball collision detection and response - Ball-to-heptagon wall collision detection and response - Each ball rotates based on its spin, showing its number with rotation - All physics and collision detection implemented from scratch with no external libraries - Fully sandboxed with no network requests or external resources The app runs in a canvas element and automatically adjusts to window size. The balls bounce realistically off the rotating heptagon walls and each other, with their numbers rotating to show their spin.