oneshotlm
Compare all models on this prompt →

Boids flocking · qwen3.5-plus-20260420

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
The user wants a full-screen flocking simulation (boids algorithm) with:
1. Separation - boids steer away from nearby boids
2. Alignment - boids steer toward the average heading of neighbors
3. Cohesion - boids steer toward the center of mass of neighbors
4. Drawn as oriented triangles (pointing in direction of movement)
5. Smooth steering
6. Mouse cursor avoidance (flee from mouse)

All in a single index.html file with inline CSS and JS, no external resources.

Let me write a comprehensive, visually appealing implementation.
write /tmp/ws/index.html (8452 bytes)
toolResult

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

assistant
thinking
The user asked me to build a flocking simulation. Let me verify the file was written correctly.
bash {"command":"ls -la /tmp/ws/index.html"}
toolResult

-rw-r--r--. 1 node node 8455 Aug 1 19:47 /tmp/ws/index.html

assistant
thinking
I've created a full flocking simulation with boids. Let me review what I've built to make sure it's complete and polished:

1. Full-screen canvas with dark background
2. 300 boids with separation, alignment, and cohesion behaviors
3. Boids drawn as oriented arrowhead/triangle shapes
4. Mouse cursor interaction - boids flee from the mouse
5. Smooth steering with clamped speed
6. Subtle trail effect via semi-transparent background fill
7. Warm color palette for boids with subtle glow
8. Edge avoidance so boids turn back toward center
9. Click to spawn more boids
10. All self-contained in one HTML file

The file is ready at /tmp/ws/index.html.

Done. The file is at `/tmp/ws/index.html` — a single self-contained file with everything inline. **Features:** - **300 boids** with classic flocking: separation (avoid crowding), alignment (match neighbors' heading), and cohesion (steer toward flock center) - **Oriented arrowhead triangles** drawn in warm hues (orange-yellow) with subtle glow - **Mouse flee** — boids within a 160px radius scatter away from the cursor, with a faint circle showing the flee zone - **Smooth steering** — forces are clamped per-frame so turns are fluid, not jerky; speed is bounded between min and max - **Edge avoidance** — boids gently steer away from the canvas edges - **Subtle trails** — semi-transparent background each frame creates a motion trail effect - **Click** to spawn 10 more boids at the cursor - **Touch support** — works on mobile too

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.5-plus-20260420
vendorQwen
harnesspi-agent
generated2026-08-01

EVALUATION

4/5 working

Boids flock in glowing colored trails, self-animate constantly, and visibly flee/scatter from mouse click, drag, and wheel.

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 motion33.7%
on click29.5%
on drag35.4%
on wheel35.6%
on enter + space33.7%
on arrow keys33.0%
on w/a/s/d31.8%
frame spread34.7 / 255
console errors0
js errors none

METRICS

runtime67.4s
tokens in11k
tokens out3.5k
cached0
cost / run$0.0096