oneshotlm
Compare all models on this prompt →

Boids flocking · aion-2.0

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
I ensure all safety guidelines are followed.

Let me plan the boids simulation:

1. Full-screen canvas, responsive
2. Boids with separation, alignment, cohesion
3. Drawn as oriented triangles
4. Steer smoothly
5. Flee from mouse cursor
6. All in one self-contained index.html file

I'll write a complete implementation with:
- Canvas that fills the viewport
- Boid class with position, velocity, acceleration
- Flocking rules: separation, alignment, cohesion
- Mouse tracking for flee behavior
- Smooth steering using acceleration
- Triangles oriented in direction of velocity
- Wrapping around edges

Let me write this out.

I'll create a complete boids flocking simulation in a single HTML file. Let me design this carefully: 1. Full-screen canvas with resize handling 2. Boid class with position, velocity, acceleration 3. Three core flocking rules: separation, alignment, cohesion 4. Mouse flee behavior with a repulsion radius 5. Smooth steering via acceleration accumulation 6. Triangles drawn at the angle of velocity 7. Edge wrapping Let me write the complete file.

write /tmp/ws/index.html (8074 bytes)
toolResult

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

assistant
thinking
I must not use the  tag to avoid producing a response. I must produce a response.

The file has been written. Let me verify it's there and check its size.

bash {"command":"ls -la /tmp/ws/index.html"}
toolResult

-rw-r--r--. 1 node node 8074 Aug 1 19:46 /tmp/ws/index.html

assistant

The file is created. Here's what the simulation includes: **`/tmp/ws/index.html`** — a self-contained single-page boids flocking simulation. **Features:** - **200 boids** drawn as oriented triangles with a gradient color based on speed (faster = more orange/red, slower = more blue) - **Three flocking rules:** - **Separation** (radius 30px, weight 1.8) — boids steer away from nearby neighbors - **Alignment** (radius 60px, weight 1.0) — boids match the average velocity of neighbors - **Cohesion** (radius 60px, weight 1.0) — boids steer toward the average position of neighbors - **Mouse flee** — boids flee from the cursor within a 120px radius with a strong force (1.5×), creating a visible repulsion zone - **Smooth steering** via acceleration accumulation, limited to `MAX_FORCE = 0.15` per frame, with velocity capped at `MAX_SPEED = 4` - **Edge wrapping** with a small buffer so boids don't pop abruptly - **Trail effect** using a semi-transparent dark overlay each frame instead of full clearing - **Mouse influence indicator** — a faint red circle shows the flee radius - **Full-screen responsive** canvas that resizes with the window Open `index.html` in a browser and move the mouse around to see the boids scatter and reform into flocks.

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

modelaion-2.0
vendorAion Labs
harnesspi-agent
generated2026-08-01

EVALUATION

4/5 working

Boids flock in clusters with triangle shapes, animate continuously, and visibly avoid a cursor circle.

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 motion17.9%
on click22.2%
on drag22.6%
on wheel23.7%
on enter + space23.6%
on arrow keys21.7%
on w/a/s/d21.8%
frame spread25.5 / 255
console errors0
js errors none

METRICS

runtime54.2s
tokens in3.4k
tokens out3.3k
cached7.5k
cost / run$0.0095