oneshotlm
Compare all models on this prompt →

Boids flocking · gemini-3.1-flash-lite-preview

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 · 4 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
**Developing Boids Simulation**

I'm focusing on the core Boids behaviors: separation, alignment, and cohesion. I'm aiming for smooth steering and want to integrate oriented triangles for the boids' visual representation. I also want to incorporate fleeing behavior driven by the mouse cursor, and the goal is a fully functional flocking simulation within a single HTML file, without any external dependencies.


**Constructing Base Framework**

I've set up the HTML and CSS for a full-screen canvas. Now, I'm working on the JavaScript, specifically the `Boid` class. I'm defining properties and methods for movement, flocking (alignment, cohesion, separation), and fleeing. I'm also considering a small Vector class with familiar methods. I'm focusing on smooth steering by calculating acceleration as the difference between desired steering and current velocity.


write index.html (5462 bytes)
toolResult

Successfully wrote 5462 bytes to index.html

assistant

The flocking simulation is complete and contained within `index.html`. It features boids that use Reynolds' steering behaviors (Separation, Alignment, Cohesion) to move as a flock, interact with the screen boundaries, and flee from the mouse cursor. You can view the simulation by opening `index.html` in any web browser.

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

modelgemini-3.1-flash-lite-preview
vendorGoogle
harnesspi-agent
generated2026-07-22

EVALUATION

4/5 working

Boids flock and swirl continuously as glowing triangles; motion appears self-animated with no clear cursor-flee reaction visible in stills.

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 motion8.9%
on click9.0%
on drag9.0%
on wheel8.8%
on enter + space8.7%
on arrow keys9.0%
on w/a/s/d9.1%
frame spread15.8 / 255
console errors0
js errors none

METRICS

runtime7.5s
tokens in4.8k
tokens out2.1k
cached0
cost / run$0.0044