next up previous contents index
Next: A little bit of Up: Program examples Previous: Factorial   Contents   Index

The snowflake (with thanks to Georges Noël)

to koch :order :len
if :order < 1 | :len <1 [forward :len stop]
koch :order-1 :len/3
lt 60
koch :order-1 :len/3
rt 120
koch :order-1 :len/3
lt 60
koch :order-1 :len/3
end
to kochflake :order :len
repeat 3 [rt 120  koch :order :len]
end

kochflake 5 450

Figure: The snowflake
\includegraphics[width=15 cm]{pics/flocon.eps}



Loïc 2008-06-08