Dragon curve: Difference between revisions
simplify base geometry
m (slight code cleanup) |
(simplify base geometry) |
||
Line 168:
require 'plot'
start=: 0 0,: 1 0
step=: ],{: +"1 (0 _1,: 1 0) +/ .*~ |.@}: -"1 {:
plot<"1|:step^:
In english: Start with
iteration, retrace that geometry backwards, but oriented 90 degrees about its
original end point. To show the curve you need to pick some arbitrary
number of iterations.
Any
-start+123 works just fine though of course the orientation and
coordinates will be different.)
For a more colorful display, with a different color for the geometry
introduced at each iteration, replace that last line of code with:
([:pd[:<"1|:)every'reset';|.'show';step&.>^:(i.
=={{header|Logo}}==
|