Interactive standalone simulations of the core algorithms from Mitchel Resnick’s Turtles, Termites, and Traffic Jams: Explorations in Massively Parallel Microworlds (1994).
Each simulation demonstrates how complex emergent behavior arises from simple agent rules in decentralized systems — no central controller, no global plan.
| Artifact | Algorithm | Emergent Behavior |
|---|---|---|
| traffic | Nagel-Schreckenberg traffic model | Spontaneous jams propagate backward |
| boids | Reynolds flocking (separation/alignment/cohesion) | Coordinated flock movement without a leader |
| termites | Termite wood gathering | Scattered chips self-organize into piles |
| fire | Forest fire percolation | Critical density threshold for fire spread |
| ants | Ant foraging with pheromone trails | Efficient paths emerge from random exploration |
| slime | Slime mold chemotaxis | Cells aggregate into clusters via pheromone gradients |
| predator-prey | Wolf-sheep-grass dynamics | Lotka-Volterra population oscillations |
Each simulation has a strict two-layer split:
sim/*.js — Pure algorithm modules. No DOM, no Canvas, no Math.random().
Deterministic when given a seeded PRNG (mulberry32 via sim/rng.js).
Exports createState(), step(), and domain-specific helpers.
*.html — Self-contained interactive artifacts. Import from sim/ via
ES modules. Own the Canvas rendering, UI controls, and animation loop.
Each HTML artifact includes an inline changelog section visible at the bottom
of the page. These record post-release bug fixes with enough detail to
understand the problem, diagnosis, and resolution – no commit log or issue
tracker required. See predator-prey.html and termites.html for examples.
Open any .html file in a browser. Each artifact includes: