oneshotlm
Compare all models on this prompt →

Boids flocking · muse-glimmer-30b

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
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.

We need single-page web app, write it ALL into one self-contained file named index.html in current directory: CSS in <style>, JS in <script>, inline — do not create separate .css/.js files. Use NO external resources, CDNs or network requests: artifact runs fully sandboxed with no network. End with index.html present.

Current working directory /tmp/ws

We need to create index.html.

Implement boids. Full-screen canvas. Oriented triangles. Steer smoothly. Flee from mouse cursor.

No external resources.

Let's build file.

Need to ensure full screen, resize handling.

Boids parameters: maxSpeed, maxForce, perception radii for separation/alignment/cohesion, flee radius.

Draw oriented triangles: point towards velocity.

Flee from mouse cursor: if mouse within flee radius, steer away.

Maybe add UI controls? Could be simple.

Implementation plan:

HTML structure:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Boids</title>
<style> ... </style>
</head>
<body>
<canvas id="c"></canvas>
<script> ... </script>
</body>
</html>

CSS: body margin0, overflow hidden, background black, canvas display block.

JS: canvas full window. Resize listener.

Boid class with position x,y, velocity vx,vy, acceleration ax,ay.

Update: apply forces, limit speed, wrap around edges? Typically wrap. Could bounce. Let's do wrap for full screen.

Steering: seek? No.

Separation: steer away from close neighbors.

Alignment: match velocity.

Cohesion: steer towards center of mass.

Implementation typical Craig Reynolds.

Flee from mouse: if distance < fleeDist, steer away.

Smooth steering: acceleration accumulates, then update velocity, limit.

Draw triangle: calculate angle = atan2(vy,vx). Draw path.

Performance: maybe 150 boids.

Add mouse tracking.

Add optional trail? Could be nice but okay.

No external resources.

Make self-contained.

Write file.

Let's create with write tool.
write /tmp/ws/index.html (5509 bytes)
toolResult

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

assistant
thinking
File written. Might want to ensure present. Could verify read.
bash {"command":"ls -l /tmp/ws/index.html"}
toolResult

-rw-r--r--. 1 node node 5511 Aug 13 01:24 /tmp/ws/index.html

assistant
thinking
We have file. Provide summary.

Created a self-contained full-screen boids simulation at **/tmp/ws/index.html**. Features: - Separation / Alignment / Cohesion with smooth steering - Oriented triangles drawn toward velocity with speed-based glow - Full-screen canvas, edge wrapping, resize aware - Mouse cursor repels boids within a flee radius - Click to spawn boids, HUD shows count - No external resources — CSS and JS inlined Open the file in a browser to interact.

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

modelmuse-glimmer-30b
vendorMeta
harnesspi-agent
generated2026-08-13

EVALUATION

4/5 working

Boids flock into swirling clusters with glowing trails, animates continuously and reacts to click by dispersing.

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 motion7.2%
on click12.8%
on drag14.0%
on wheel12.2%
on enter + space13.2%
on arrow keys12.8%
on w/a/s/d13.5%
frame spread32.7 / 255
console errors0
js errors none

METRICS

runtime30.6s
tokens in10k
tokens out2.5k
cached6.6k
cost / run$0.0054