Boids flocking · kimi-k3
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.
thinking
Create a single index.html with boids. Include spatial grid maybe; keep simple but performant with ~250 boids and a spatial hash. Flee mouse, wrap edges, oriented triangles.
/workspace/index.html (7150 bytes)Successfully wrote 7150 bytes to /workspace/index.html
Created `index.html` — a fully self-contained, full-screen flocking simulation. **Features:** - **Classic Reynolds rules**: separation (inverse-square repulsion within 26px), alignment, and cohesion (within 70px perception radius) - **Smooth steering**: all rules produce desired-velocity vectors limited by `maxForce`, so boids turn organically rather than snapping - **Mouse fleeing**: boids within 150px of the cursor are strongly repelled, with force scaled by proximity; a faint red ring shows the danger zone - **Oriented triangles**: each boid is drawn as a glowing arrowhead rotated to its velocity, with hue/lightness shifting by speed - **Performance**: spatial-hash grid for O(n) neighbor lookups, DPR-aware rendering, motion-trail fade effect - **Extras**: click to spawn boids at the cursor, space to pause, edge wrapping, gentle wander noise for lone boids Open it in any browser — no network or external resources needed.
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 smoothly with glowing triangle shapes, flee from cursor circle, click adds boids; arrows/WASD have no effect.
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.