oneshotlm
Compare all models on this prompt →

Boids flocking · minimax-m2

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 · 8 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 boids flocking simulation with:
1. Separation, alignment, and cohesion behaviors
2. Drawn as oriented triangles
3. Smooth steering
4. Flee from mouse cursor
5. Full-screen

I'll create a single HTML file with embedded CSS and JS. The simulation will use the classic Reynolds boids algorithm with:
- Separation: steer to avoid crowding local flockmates
- Alignment: steer towards the average heading of local flockmates
- Cohesion: steer to move toward the average position of local flockmates
- Plus mouse avoidance (flee behavior)

Let me write this as a complete, self-contained file.
write /tmp/ws/index.html (13424 bytes)
toolResult

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

assistant
thinking
I've created a complete boids flocking simulation. Let me verify the file was created correctly.
bash {"command":"ls -la /tmp/ws/index.html"}
toolResult

-rw-r--r--. 1 node node 13424 Aug 1 19:46 /tmp/ws/index.html

assistant
thinking
The file has been created successfully. Let me verify it's valid HTML by checking for basic structure.
bash {"command":"head -20 /tmp/ws/index.html && echo \"...\" && tail -10 /tmp/ws/index.html"}
toolResult

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Boids Flocking Simulation</title> <style> * { margin: 0; padding: 0; box-sizing: border-box; } body { overflow: hidden; background: #0a0a12; font-family: 'Courier New', monospace; } canvas { ... } requestAnimationFrame(animate); } init(); animate(); </script> </body> </html>

assistant
thinking
The file is complete and valid. Let me provide a summary to the user.

Done! I've created a full-screen boids flocking simulation in `/tmp/ws/index.html`. **Features implemented:** - **150 boids** rendered as oriented triangles with gradient fills and subtle glow - **Three flocking behaviors:** - **Separation** - avoid crowding neighbors - **Alignment** - steer toward average heading of neighbors - **Cohesion** - steer toward average position of neighbors - **Mouse flee behavior** - boids scatter when the cursor approaches (shown with a red circle indicator) - **Smooth steering** with max force limits - **Trail effect** for visual appeal - **Touch support** for mobile devices - **FPS counter** in the bottom-left corner The boids have varied colors from a vibrant palette and wrap around screen edges. Open `index.html` in a browser to see the simulation in action!

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

modelminimax-m2
vendorMiniMax
harnesspi-agent
generated2026-08-01

EVALUATION

4/5 working

Colorful flocking boids animate continuously with fleeing behavior visible around the mouse cursor circle (visible pointer indicator).

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 motion22.4%
on click22.1%
on drag23.1%
on wheel24.2%
on enter + space23.1%
on arrow keys22.6%
on w/a/s/d22.7%
frame spread26.4 / 255
console errors0
js errors none

METRICS

runtime33.3s
tokens in16k
tokens out3.4k
cached0
cost / run$0.0074