Boids flocking · ling-2.6-1t
Output generated Cost / run $0.0030 Runtime 28.1s
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.
I'll create a full-screen flocking simulation with boids as oriented triangles that exhibit separation, alignment, and cohesion behaviors, plus mouse flee behavior.
/tmp/ws/index.html (9891 bytes)Successfully wrote 9891 bytes to /tmp/ws/index.html
I've created a complete full-screen flocking simulation with the following features: **Core Boid Behaviors:** - **Separation** (weight 1.4): Boids steer to avoid crowding neighbors within 30px - **Alignment** (weight 1.0): Boids match velocity with neighbors within 60px - **Cohesion** (weight 0.8): Boids steer toward the center of mass of neighbors within 80px - **Mouse Flee**: Boids actively flee from the mouse cursor within 120px radius **Visual Design:** - Boids rendered as oriented triangles with gradient fills and glow effects - Cyan-to-green color palette with individual hue variation - Subtle grid background for spatial reference - Pulsing red influence ring around the mouse cursor - Smooth fading trail effect for motion blur **Interactions:** - Mouse movement triggers flee behavior with visual feedback - Touch support for mobile devices - Automatic wrap-around at screen edges - Responsive full-screen canvas that resizes with the window The boids exhibit natural flocking behavior - they group together, move in similar directions, avoid collisions, and scatter when the mouse approaches, creating an organic, lifelike swarm.