Generate a Koch Snowflake
A Koch snowflake is a triangle that for each n
, another equilateral point is added in the middle of each side: http://en.wikipedia.org/wiki/Koch_snowflake#Properties
We already had a kolmogrov-complexity Koch Snowflake challenge for n=4
. The new challenge is to draw a Koch snowflake with any n
between 1
and 10
.
Rules
The snowflakes may not be hardcoded in the program or in files - they must be generated by your program.
Your program must support all sized
n
between 1 and 10.The number of sides must be input by the user through std-in.
You must print a graphical representation of the snowflake to the screen.
Sample Koch Snowflakes with n
equaling 1, 2, 3, and 4 (green lines for clarity only, do not reproduce them):
In the event of a tie-breaker, the program with the highest number of upvotes wins (pop-contest).
n=7
, you can't see the newly added triangles in the snowflake on a computer screen. Is any "best effort" here OK? Is there a minimum resolution for pixel-based solutions? \$\endgroup\$