Boids — Flocking Simulation
Craig Reynolds' 1986 boids model: large-scale flocking behavior emerging from three local rules applied per agent — separation (don't crowd neighbors), alignment (steer toward the average heading of neighbors), cohesion (steer toward the average position of neighbors). No central coordinator, no plan — just three vectors per timestep per agent.
The demo is the canonical setup in plain JS + canvas, with my own thin vector library. Source on GitHub.