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:
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.