why
keyflake was my entry to the 2005 simplicity snowflake-a-thon competition. the idea of the competition was that john maeda wasn't happy with the usual algorithm for generating snowflakes, and he's right. it looks nothing like a snowflake. so how do you make a computational snowflake in a simple way? his solution was to hold a competition asking for 'the simplest computer program that generates the most beautiful snowflake'.
"install"
if you have java, one simple thing to do is to download the tiny jar that holds the program. on most systems you can just double-click to run it. if that doesn't work, try typing java -cp Snowflake.jar SnowflakeWindow in the command line while you're in the same directory as the jar file.
if you like java applets or the above instructions fail, you can hyperlink yourself to the keyflake applet on this site.
once you're running
generally, each key you type should grow the snowflake. there are some special keys: ESC resets the flake; F5-F9 resets the flake and changes the number of sides to 5, 6, 7, 8, or 9; ENTER generates a random key. for a fun time, try holding down ENTER.
how it works
one of the things i find really amazing about the little snowflake algorithm i discovered, is how surprisingly simple - yet still deterministic - it is. also, there are almost no arbitraty rules, and it's easily repeatable by anyone with a little programming experience.
still, the tiny program creates lots of vastly different looking snowflakes, based only on a short string of text and a straightforward process. it reminded me of the possibility that all of the diversity of living nature comes from just a short(ish) string of d.n.a and a - ahem somewhat straightforward - process.
anyway, without further ado, here's how it works:
- start with 6 (or however many you choose) lines going out
- each keystroke grows the lines
- if the key's ascii code divides by 4, split two new branches off each line
- the branching angle is just the key's ascii code in degrees
- new lines grow at 1/2 the speed and are 3/5 as wide as their trunk
i should note that branches that are too tiny, are not further split