oneshotlm
Compare all models on this prompt →

Boids flocking · gemini-3.1-flash-lite

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 currently focused on the core boids behavior, specifically implementing separation, alignment, and cohesion following Reynolds' rules. I'm representing each boid as an oriented triangle to give them a clear direction. Next, I plan to work on smooth steering and mouse-cursor interaction, for fleeing behavior.


**Refining Boid Implementation**

I've been working on creating a single, self-contained HTML file. This involves using canvas for animation, and building a `Boid` class to store all the properties. The main loop is set up to update and draw the boids. I am currently fleshing out the math for separation, alignment, and cohesion behaviors, along with mouse avoidance. I'm also styling the visuals for a fullscreen black background and white boids, all within the constraints of the single file.


write index.html (4873 bytes)
toolResult

Successfully wrote 4873 bytes to index.html

assistant

The flocking simulation is complete and contained in `index.html`. It uses a canvas element to render approximately 100 boids that follow Reynolds' rules (Separation, Alignment, Cohesion) and react to mouse movement by fleeing. You can open `index.html` in any modern web browser to view the simulation.

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
vendorGoogle
harnesspi-agent
generated2026-07-22

EVALUATION

3/5 working

Boids animate as tiny triangles moving on a black screen; flocking behavior is barely visible and inputs show no clear reaction.

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 motion2.2%
on click1.0%
on drag0.5%
on wheel0.2%
on enter + space0.1%
on arrow keys0.0%
on w/a/s/d0.0%
frame spread16.5 / 255
console errors0
js errors none

METRICS

runtime6.9s
tokens in4.9k
tokens out2.2k
cached0
cost / run$0.0045