oneshotlm
Compare all models on this prompt →

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

Output generated Cost / run $0.0044 Runtime 7.5s

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

METRICS

runtime7.5s
tokens in4.8k
tokens out2.1k
cached0
cost / run$0.0044
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.