oneshotlm
Compare all models on this prompt →

Boids flocking · qwen3.5-flash-02-23

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 me to create a boids flocking simulation as a single self-contained HTML file. This needs to include:

1. CSS for full-screen styling
2. JavaScript implementing boids algorithms with:
   - Separation (avoid crowding neighbors)
   - Alignment (steer towards average heading of neighbors)
   - Cohesion (steer towards average position of neighbors)
3. Boids drawn as oriented triangles
4. Smooth steering/acceleration
5. Mouse interaction (boids flee from cursor)
6. Everything in one index.html file with inline CSS and JS

Let me write this complete implementation:
write /tmp/ws/index.html (8360 bytes)
toolResult

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

assistant
thinking
The file has been created. Let me verify it exists and is readable.
bash {"command":"ls -la /tmp/ws/index.html && head -20 /tmp/ws/index.html"}
toolResult

-rw-r--r--. 1 node node 8362 Aug 1 17:32 /tmp/ws/index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Boids Flocking Simulation</title> <style> * { margin: 0; padding: 0; box-sizing: border-box; } html, body { width: 100%; height: 100%; overflow: hidden; background: #0a0a15; } canvas { display: block;

assistant
thinking
Done! I've created `/tmp/ws/index.html` — a self-contained full-screen flocking simulation with:

- **315 boids** rendered as oriented triangles with subtle color variations
- **Separation**: Boids steer away from nearby neighbors to avoid crowding
- **Alignment**: Boids steer toward the average heading of nearby neighbors  
- **Cohesion**: Boids steer toward the average position of nearby neighbors
- **Mouse flee**: Boids panic and flee when mouse enters their vicinity (200px radius)
- **Smooth steering**: Physics-based movement with velocity, acceleration, and force limiting
- **Edge wrapping**: Boids wrap around screen edges instead of disappearing
- **Trail effect**: Previous frame fades slightly for visual motion trails

To view it, open `index.html` in a browser. Move your mouse to scatter the flock and click to respawn them!

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-flash-02-23
vendorQwen
harnesspi-agent
generated2026-08-01

EVALUATION

3/5 working

Boids flock and drift as colored triangles across the screen; continuous idle animation but no clear distinct reaction to inputs 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 motion6.2%
on click8.8%
on drag8.7%
on wheel8.5%
on enter + space8.4%
on arrow keys8.5%
on w/a/s/d8.5%
frame spread14.4 / 255
console errors0
js errors none

METRICS

runtime13.9s
tokens in9.2k
tokens out2.4k
cached0
cost / run$0.0012