Dragon curve: Difference between revisions
Content deleted Content added
RapidQ added |
added J (as Raul Miller's proxy) |
||
Line 164: | Line 164: | ||
}</d> |
}</d> |
||
|} |
|} |
||
=={{header|J}}== |
|||
require 'plot' |
|||
start=: 0 0, 1 0,: 1 1 |
|||
step=: ],{: +"1 (2 2$0 _1 1 0) +/ .*~ |.@}: -"1 {: |
|||
plot<"1|:step^:12 start |
|||
In english: Start with an L shaped geometry. For each step of |
|||
iteration, retrace that geometry, but oriented 90 degrees about its |
|||
original end point. To show the curve you need to pick some arbitrary |
|||
number of iterations. |
|||
Any L-shaped set of points is suitable for start. (For example, |
|||
-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 with: |
|||
([:pd[:<"1|:)every'reset';|.'show';step&.>^:(i.16)<start |
|||
=={{header|Logo}}== |
=={{header|Logo}}== |
||