TechNoviceTools — P5JS Processing — SPARK Edition

Math Mambo Saga

Three colored lights. One rule. One astonishing fractal.
The Chaos Game — Stage 4, live in your browser.

About the Math Mambo — what is the Chaos Game?

Three colored floor-lights are placed at the corners of an equilateral triangle on a digital dance floor. A mathematician stands somewhere on the floor. At each beat, one of the three lights blinks at random, and the mathematician moves exactly halfway toward it. The dance floor lights up at every new position — in the color of the light that triggered the move.

The result seems like it should be a random smear of colored dots. It isn’t. What actually emerges — dot by dot, step by step — is the Sierpiński Triangle, one of the most famous fractals in mathematics.

Red light  •  Green light  •  Blue light

To dance: Press Start, or click anywhere on the canvas to place the dancer and begin. The fractal builds with each step. Try high frame rates for a timelapse — or slow ones to watch the pattern emerge step by step.

S.P.A.R.K. Chat Log  •  See the original Flash animation  •  Sierpiński at Wolfram MathWorld

The canvas is sized when the page loads — set your browser window before clicking Start. On mobile and tablet, tapping the lights works fine.

…loading canvas…

 

Click the canvas to place the dancer & start the dance!


Controls

Stats
Steps 0
Running time 0.0 s