oneshotlm
Compare all models on this prompt →

Boids flocking · claude-opus-4.8

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 ↗
transcript · 8 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

I'll create a full-screen boids flocking simulation with all the classic behaviors plus mouse fleeing.

write /workspace/index.html (7255 bytes)
toolResult

Successfully wrote 7255 bytes to /workspace/index.html

assistant
thinking
I'm removing some redundant separation logic and cleaning up an unnecessary limit operation.

Let me clean up a couple of redundant lines I left in.

edit {"path":"/workspace/index.html","edits":[{"oldText":" sepX /= sepN; sepY /= sepN;\n setMag({x: sepX, y: sepY}, CFG.maxSpeed);\
toolResult

Successfully replaced 2 block(s) in /workspace/index.html.

assistant
bash {"command":"cd /workspace && node -e \"require('fs').readFileSync('index.html','utf8'); console.log('ok, bytes:', require('fs').statSync('in
toolResult

ok, bytes: 7170

assistant

Done. `index.html` is a self-contained full-screen boids flocking simulation. **Features implemented:** - **Separation** — boids steer away from close neighbors (inverse-distance weighted) - **Alignment** — match average heading of nearby flockmates - **Cohesion** — steer toward the local center of mass - **Smooth steering** — each rule produces a steering force capped by `maxForce`, so boids turn gradually rather than snapping - **Mouse flee** — boids within a radius accelerate away from the cursor, strength scaling with proximity - **Oriented triangles** — each boid is drawn as a glowing arrow-triangle rotated to face its velocity - **Motion trails** via semi-transparent frame clearing, edge wrapping, hue variation, and click-to-spawn more boids Open it in any browser — no network or external resources required.

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

4/5 working

Boids with trails flock and cluster continuously, colored triangles with alignment/cohesion visible, but flee-from-cursor effect isn't clearly shown.

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 motion3.1%
on click8.1%
on drag8.2%
on wheel7.3%
on enter + space7.7%
on arrow keys7.9%
on w/a/s/d5.3%
frame spread13.7 / 255
console errors0
js errors none

METRICS

runtime49.6s
tokens in4.4k
tokens out4.4k
cached13k
cost / run$0.1611