oneshotlm
Compare all models on this prompt →

Boids flocking · gemini-3.1-flash-lite

Output generated Cost / run $0.0045 Runtime 6.9s

Prompt for this run

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 ↗

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

METRICS

runtime6.9s
tokens in4.9k
tokens out2.2k
cached0
cost / run$0.0045
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.