oneshotlm
Compare all models on this prompt →

Boids flocking · claude-opus-5

Output generated Cost / run $0.2294 Runtime 70.3s

Prompt for this run

Create a full-screen flocking simulation of boids using separation, alignment, and cohesion, drawn as oriented triangles that steer smoothly and flee from the mouse cursor.

⛨ 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

modelclaude-opus-5
vendorAnthropic · Claude
harnesspi-agent
generated2026-08-03

METRICS

runtime70.3s
tokens in21k
tokens out7.2k
cached14k
cost / run$0.2294
Transcript · 6 messages
user

Create a full-screen flocking simulation of boids using separation, alignment, and cohesion, drawn as oriented triangles that steer smoothly and flee from the mouse cursor.

assistant
thinking
I'll create a single HTML file with a canvas-based flocking simulation, incorporating a spatial grid for efficient performance and adding interactive sliders for parameter control.
→ write /tmp/ws/index.html (13201 bytes)
toolResult

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

assistant
→ bash {"command":"cd /tmp/ws && node -e \"const s=require('fs').readFileSync('index.html','utf8');const m=s.match(/<script>([\\s\\S]*)<\\/script>/
toolResult

js ok 13201

assistant

`index.html` created — a self-contained full-screen boids flocking sim. - **Flocking**: separation (inverse-square repulsion), alignment, cohesion, all as clamped steering forces (`desired - velocity`, limited by maxForce) for smooth turning. - **Rendering**: oriented triangles colored by heading hue + speed, optional motion trails via alpha fade, toroidal wrapping. - **Mouse**: boids flee the cursor with a falloff-weighted, stronger-than-normal steer force; click/hold expands the panic radius. Red halo shows the influence zone. - **Performance**: spatial hash grid + flat typed arrays, handles ~1200 boids. - **UI**: sliders for count/weights/vision/speed/flee, toggles for trails, vision radii, pause. Keys: `space` pause, `t` trails, `v` radii, `r` reset.