Permanent Links


What should be the topic for the next Impossibly Stupid poll?

A Town Square Poll Space

Tech Corner

See Also

[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory  -  
[TXT]README.html2015-04-03 23:00 1.6K 
[DIR]chaos_game/2016-06-07 18:46 -  
[   ]info.json2014-12-09 01:41 40  
[   ]tags=play2015-03-26 18:30 0  

Anarchy: good luck with that!

Some people have a hard time grasping that disorder can yield order, or that an impossibly stupid approach can yield beautiful results. Those people have clearly never heard of the Chaos Game. I bet you knew my earlier talk of fractals would get us here eventually.

Or perhaps you have heard of the Chaos Game, but you're just disappointed by the 10 year old Java applets around the web. For your amusement, I present what looks to be the first decent JavaScript version. Click in the drawing area to set your points, pick your decimal fraction to move, and let it go! Suggestions for improvements and/or bug reports are appreciated.

Note: my code attempts to use the canvas element to draw the dots. For browsers that don't support that, the code uses 1 pixel div elements. Having thousands of elements in the document for longer plots can potentially suck up a lot of resources. If you're going to let it run for longer than around 30 seconds, you're probably best served by using a browser with canvas support.

Update: the code has been modified since original publication as explained here