oneshotlm
Compare all models on this prompt →

Bouncing balls in a heptagon · claude-opus-4.8

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.

⛨ sandboxed Open in new tab ↗
transcript · 4 messages
user

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.

assistant
thinking
I'm building an interactive physics simulation with 20 numbered balls dropping from the center of a spinning heptagon, implementing gravity, friction, ball-to-ball collisions, and bouncing off the rotating walls, with the ball numbers rotating to show their spin.

Writing physics engine...
write /workspace/index.html (8283 bytes)
toolResult

Successfully wrote 8283 bytes to /workspace/index.html

assistant

Created `/workspace/index.html`. It's a self-contained single file with everything inline. Highlights: - **20 numbered balls** spawn from the heptagon's center with slight random velocities. - **Spinning heptagon**: rotates 360° every 5 seconds (`SPIN = 2π/5` rad/s), vertices recomputed each frame. - **Gravity + friction**: constant downward acceleration plus per-step velocity damping. - **Self-implemented collision detection**: - *Ball–wall*: closest point on each edge segment, inward-normal reflection with restitution. Wall velocity (`ω × r`) is factored in so balls get kicked by the moving edges realistically. - *Ball–ball*: pairwise distance check with positional separation and normal impulse resolution. - **Spin visualization**: each ball's number (plus a small tick mark) rotates based on angular velocity gained from tangential friction during collisions. - Uses sub-stepping and multiple solver iterations for stability. Open it in a browser to watch it run.

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

modelclaude-opus-4.8
vendorAnthropic · Claude
harnesspi-agent
generated2026-07-08

EVALUATION

3/5 working

Heptagon with 20 numbered balls falling and settling under gravity; rotation and physics visible, but no interactive input response since it's a passive simulation.

Vision grade · anthropic/claude-sonnet-5

MEASUREMENTS

Raw readings from the capture, not a verdict — the grade above is the only judgement. Percentages are how much of the screen changed; the measure under-reports sparse motion on a dark background.

idle motion9.1%
on click9.0%
on drag8.4%
on wheel8.6%
on enter + space8.6%
on arrow keys8.6%
on w/a/s/d8.7%
frame spread22.1 / 255
console errors0
js errors none

METRICS

runtime52.3s
tokens in4.1k
tokens out4.7k
cached4.6k
cost / run$0.1404