- Stilldreamer
- Mathematics
- Chaos Game

Building Sierpinski’s triangle with the chaos game.

The chaos game is a simple experiment which creates a skewed version of Sierpinski’s triangle—also known as the Sierpinski gasket—between three chosen points. The Macromedia Flash animation shown here is a real-time calculation and rendering of this game between three user-selected points. The rules of the chaos game are relatively simple:

- Start with a blank canvas;
- Choose three random “base” points on this canvas, labelling each of them one, two and three respectively;
- Pick an arbitrary point on the canvas, calling it the “game point”;
- Choose a random number between one and three (using a die or any other random number generation technique);
- Draw the new game point halfway in between the previous game point and the base point corresponding to the chosen random number;
- Repeat from step 4.

The number at the top of the Macromedia Flash animation is the total number of game points that have been drawn. Though the underlying ActionScript is relatively simple, the results obtained are very interesting.

Plaintext source of this program, released under the GPL.