start1=: 0 1 1 ,: 0 0 1
step1=: ,. (-/,+/)@:({:"1) + 1 _1 * |.@:(|[EMAIL PROTECTED]:"1)
plot ;/ step1^:12 start1----- Original Message ----- From: Raul Miller <[EMAIL PROTECTED]> Date: Tuesday, November 18, 2008 5:56 Subject: [Jgeneral] Re: [Jprogramming] Diagnosing fractals To: General forum <[email protected]> > I was going to add Oleg's and my version of the dragon curve to the > rosetta code page, but I am not seeing the confirmation code graphics > so I can not register nor post anonymously there. > > If someone else could add an entry for J, I would appreciate it. > > Also, if someone could identify the name of the host which provides > the confirmation code graphics, so I can check my firewall > settings, I > would appreciate it. > > Thanks, > > -- > Raul > > P.S. The rosetta code page for dragon curve is > > http://rosettacode.org/wiki/Dragon_curve > > and here is my proposed entry: > > =={{header|J}}== > > require 'plot' > start=: 0 0, 1 0,: 1 1 > step=: ],{: +"1 (2 2$0 _1 1 0) +/ .*~ |[EMAIL PROTECTED]: -"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 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
