oneshotlm
Compare all models on this prompt →

Boids flocking · grok-4.3

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 task is to build a single-page web app in one self-contained file named index.html. It must include CSS in a <style> tag, JS in a <script> tag, all inline. No external resources, CDNs, or network ...The task is to create a single-page web app in one self-contained file named index.html with CSS in <style> and JS in <script>, all inline. It should be 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.

I need to implement this in HTML5 Canvas, as it's suitable for performance with many boids.

The canvas should fill the viewport, be full-screen, and handle resize.

Boids: around 100-200, each as an oriented triangle pointing in its direction.
write /workspace/index.html (9279 bytes)
toolResult

Successfully wrote 9279 bytes to /workspace/index.html

assistant
thinking
The write succeeded. The user asked to end with index.html present. I should verify it's there.
bash {"command":"ls -la index.html && wc -c index.html"}
toolResult

-rw-r--r-- 1 node node 9281 Jul 22 16:49 index.html 9281 index.html

assistant
thinking
The file has been successfully created. It is a single self-contained HTML file with full-screen boids flocking simulation using separation, alignment, cohesion, oriented triangles, smooth steering, a...
bash {"command":"head -30 index.html && echo \"...\" && tail -20 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</title> <style> * { margin: 0; padding: 0; box-sizing: border-box; } body { background: #0a0a1a; overflow: hidden; cursor: none; } canvas { display: block; } .info { position: absolute; top: 20px; left: 20px; color: #4a9eff; font-family: monospace; font-size: 14px; pointer-events: none; text-shadow: 0 0 10px rgba(74, 158, 255, 0.5); } ... // Subtle glow on mouse if (mouse.active) { ctx.beginPath(); ctx.arc(mouse.x, mouse.y, 18, 0, Math.PI * 2); ctx.fillStyle = 'rgba(255, 80, 80, 0.08)'; ctx.fill(); ctx.beginPath(); ctx.arc(mouse.x, mouse.y, 8, 0, Math.PI * 2); ctx.fillStyle = 'rgba(255, 100, 100, 0.15)'; ctx.fill(); } requestAnimationFrame(animate); } animate(); </script> </body> </html>

assistant
thinking
The self-contained single-file index.html is complete and present in the working directory. It features a full-screen canvas with 150 boids implementing the three classic Reynolds rules (separation, a...

`index.html` created and ready.

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

modelgrok-4.3
vendorxAI · Grok
harnesspi-agent
generated2026-07-22

EVALUATION

4/5 working

Boids flock into clusters and flee cursor, continuous smooth animation matches prompt well.

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 motion11.3%
on click11.4%
on drag11.3%
on wheel11.5%
on enter + space11.4%
on arrow keys11.2%
on w/a/s/d11.2%
frame spread18.5 / 255
console errors0
js errors none

METRICS

runtime32.8s
tokens in4.1k
tokens out3.0k
cached9.2k
cost / run$0.0145