Chaos Game illustration

Chaos Game

The chaos game is a startling recipe: pick corners of a shape, drop a point anywhere, then repeatedly jump part of the way toward a randomly chosen corner, marking each spot. With three corners and half-way jumps, the random dots never fill the triangle — they trace the Sierpiński gasket, a fractal, with perfect detail. Change the number of corners, the jump fraction and simple restrictions (like forbidding the same corner twice) and completely different fractals emerge, including patterns close to the Barnsley fern. Points rain down thousands per second, colour-coded by the corner chosen, building the attractor before your eyes.

Runs 100% in your browser — simulations are computed locally on your device.

Notes

  • Each rule is an affine contraction (move a fraction of the way to a corner), and the set of dots converges to the attractor of that iterated function system — the same points every time, despite the random order.
  • Three corners with a one-half jump give the Sierpiński triangle exactly; the randomness only decides the order points are drawn, not which points appear.
  • With four corners you must forbid repeating a corner to get structure, showing how a small change to the rules reshapes the whole fractal.
  • Runs 100% in your browser — simulations are computed locally on your device.