oneshotlm
Compare all models on this prompt →

Boids flocking · qwen3.7-flash

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 ↗
transcript · 6 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
The user wants a single-page web app with a flocking boids simulation. Let me build this with:

1. Full-screen canvas
2. Boids algorithm with separation, alignment, cohesion
3. Oriented triangles for rendering
4. Mouse interaction (flee from cursor)
5. All in one index.html file with inline CSS and JS
6. No external resources

Let me write a complete, polished implementation.
write /tmp/ws/index.html (11048 bytes)
toolResult

Successfully wrote 11048 bytes to /tmp/ws/index.html

assistant
thinking
Let me verify the file was written correctly and exists.
bash {"command":"wc -l /tmp/ws/index.html && head -3 /tmp/ws/index.html && echo \"---\" && tail -3 /tmp/ws/index.html"}
toolResult

357 /tmp/ws/index.html <!DOCTYPE html> <html lang="en"> <head> --- </script> </body> </html>

assistant
thinking
The file is complete and well-formed. Let me summarize what was built.

Done — `/tmp/ws/index.html` (357 lines, fully self-contained). Here's what it includes: **Boids Algorithm:** - **Separation** — boids steer away from neighbors within 28px to avoid crowding - **Alignment** — boids match velocity with neighbors within 80px perception radius - **Cohesion** — boids steer toward the center of mass of nearby flockmates **Rendering:** - Oriented forward-pointing triangles (wings + tail notch shape) - Cyan-blue hue palette with per-boid variation - Dynamic size based on speed; glow effect via shadow blur - Subtle trail fade effect on dark background **Mouse Interaction:** - Hovering creates a visible influence circle (dashed red outline); boids inside flee outward proportional to proximity - Click triggers a burst scatter force that propagates outward and fades over time - Touch support included for mobile **Performance:** - Spatial hashing grid for O(n) neighbor lookups instead of O(n²) - `requestAnimationFrame` with capped delta time for smooth motion

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

modelqwen3.7-flash
vendorQwen
harnesspi-agent
generated2026-08-01

EVALUATION

4/5 working

Smooth flocking boids with glowing trails, continuous idle motion, reacts to mouse via scatter/flee circles.

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.

idle motion34.1%
on click32.6%
on drag32.3%
on wheel36.1%
on enter + space36.0%
on arrow keys36.9%
on w/a/s/d32.5%
frame spread32.8 / 255
console errors0
js errors none

METRICS

runtime29.1s
tokens in13k
tokens out4.1k
cached0
cost / run$0.0009