oneshotlm
Compare all models on this prompt →

Boids flocking · qwen3.8-max

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 · 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
Create the boids simulation as a single index.html file. Include full-screen canvas, mouse avoidance, smooth turning, direction-indicating triangles, wrapping, and controls if needed. Keep it concise but make it polished.
write /tmp/ws/index.html (8913 bytes)
toolResult

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

assistant
thinking
(Internal thought: Quick sanity check — if node is available, maybe I can verify the JS syntax.)
bash {"command":"cd /tmp/ws && node -e \"\nconst html = require('fs').readFileSync('index.html','utf8');\nconst js = html.match(/<script>([\\s\\S
toolResult

JS syntax OK, file size: 8913

assistant
thinking
The script is an IIFE that runs immediately — `new Function(js)` only checks the syntax, and that passed. Done.

Done — `/tmp/ws/index.html` is a fully self-contained, full-screen boids simulation (no external resources). Key features: **Flocking behavior** - **Separation** — boids push away from close neighbors (weighted by 1/distance), stronger when crowded - **Alignment** — steers toward the average heading of neighbors within a 70px perception radius - **Cohesion** — steers toward the local flock's center of mass **Smooth steering** - Classic Reynolds steering (`desired − velocity`, force-capped) plus a per-frame **max turn-rate clamp**, so boids bank gracefully instead of snapping direction - Speed is kept between min/max bounds, with a small speed boost while fleeing **Mouse flee** - Boids within 130px of the cursor panic away with force scaled by proximity; a faint red ring visualizes the flee radius (touch supported too) **Rendering & details** - Boids drawn as **oriented triangles** (nose + rear corners computed from heading) in blue→purple hues, with a translucent-fill motion trail - Spatial hash grid for O(n) neighbor lookups — stays smooth at 220 boids - Soft edge-avoidance steering keeps the flock on-screen; canvas resizes with the window Just open `index.html` in a browser and move the mouse to scatter the flock.

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

modelqwen3.8-max
vendorQwen
harnesspi-agent
generated2026-08-03

EVALUATION

4/5 working

A boids flocking simulation with cursor-repelling fish-like particles, animates continuously and reacts to cursor position.

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.9%
on click13.0%
on drag12.6%
on wheel12.2%
on enter + space13.7%
on arrow keys12.8%
on w/a/s/d12.4%
frame spread14.2 / 255
console errors0
js errors none

METRICS

runtime65.0s
tokens in11k
tokens out3.7k
cached6.3k
cost / run$0.0340