Boids flocking · glm-5.3
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.
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.
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
EVALUATION
Boids flock in colorful triangle groups continuously animating, with a visible cursor-avoidance circle affecting flocks near it.
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.