Boids flocking · glm-5.3
Output generated Cost / run $0.0129 Runtime 24.8s
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.
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
METRICS
Transcript · 4 messages
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.
index.html (5886 bytes)Successfully wrote 5886 bytes to index.html
Done — `index.html` in the current directory contains the full simulation: - **220 boids** drawn as oriented triangles (nose pointing along velocity), colored by hue and speed - **Classic Reynolds rules**: separation (inverse-distance weighted), alignment, and cohesion, each applied through smooth limited steering forces - **Mouse flee**: boids panic within a 130px radius, with a force ramping up as you get closer (fear radius drawn as a faint circle) - **Soft edge containment** so flocks turn back from screen edges instead of clipping - Speed clamping (min/max) plus subtle motion trails via semi-transparent frame redraws Open it in any browser — everything is self-contained with no external resources.