Turtle Graphics
AnglePath generates the list of 2D points obtained by specifying consecutive relative displacements from the previous point. This list corresponds to the turtle graphics path of the Logo programming language.
Generate a simple turtle graphic.
In[1]:=

Graphics[Line[AnglePath[ConstantArray[110 \[Degree], 100]]]]
Out[1]=

Generate a Koch snowflake curve.
In[2]:=

Graphics[Line[AnglePath[Array[ThueMorse, 4096] 2 Pi/3]]]
Out[2]=

Generate a dragon curve.
In[3]:=

Graphics[Line[
AnglePath[{90 \[Degree], -90 \[Degree]}[[
1 + Nest[Join[#, {0}, Reverse[1 - #]] &, {0}, 10]]]]]]
Out[3]=

Generate another interesting curve.
In[4]:=

Graphics[Line[AnglePath[N@Range[100000]]]]
Out[4]=
