oneshotlm
Compare all models on this prompt →

Boids flocking · qwen3.6-27b

Output generated Cost / run $0.0158 Runtime 91.3s

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.

⛨ sandboxed Open in new tab ↗

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.6-27b
vendorQwen
harnesspi-agent
generated2026-07-31

METRICS

runtime91.3s
tokens in13k
tokens out4.2k
cached4.4k
cost / run$0.0158
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 boids flocking simulation. Let me create a self-contained index.html file with:

1. Full-screen canvas
2. Boids implemented as triangles
3. Three classic rules: separation, alignment, cohesion
4. Mouse flee behavior
5. Smooth steering
6. All CSS and JS inline

Let me write a complete, well-crafted implementation.

→ write /workspace/index.html (10771 bytes)
toolResult

Successfully wrote 10771 bytes to /workspace/index.html

assistant
thinking
The file is written. Let me verify it exists and is complete.
→ bash {"command":"wc -l /workspace/index.html && head -3 /workspace/index.html && echo \"...\" && tail -3 /workspace/index.html"}
toolResult

389 /workspace/index.html <!DOCTYPE html> <html lang="en"> <head> ... </script> </body> </html>

assistant
thinking
The file is complete. Let me confirm the key features are all present.

The `index.html` file is ready at `/workspace/index.html`. Here's what it includes: **Flocking Rules:** - **Separation** — boids steer away from nearby neighbors to avoid crowding - **Alignment** — boids steer toward the average heading of neighbors - **Cohesion** — boids steer toward the center of mass of neighbors **Visuals:** - Boids drawn as luminous oriented triangles with glow halos - Motion trails via semi-transparent background fill - Color hue shifts per boid (cyan → purple palette) - Speed-reactive size and brightness **Interactions:** - **Mouse hover** — boids flee from cursor with a smooth falloff force - **Click** — spawns a burst of 40 new boids at cursor position - **Touch support** for mobile - Custom animated cursor indicator with flee radius ring **Performance:** - Spatial grid partitioning for O(n) neighbor lookups - 400 boids by default (no hard cap — click to add more) - Toroidal wrapping with edge avoidance at screen borders