Hallo Devon McCormick, je schreef op 07-01-10 19:50:
> It is an interesting picture but the pseudo-code falls short of fully
> describing the alogrithm.  The core of it is as follows (where "counter" is
> a prime):
>
> let x = mod(counter,11);
>
> if(x=1) move position up;
> else if(x=2) move position down;
> else if(x=3) move position right;
> else if(x=4) move position left;
> else if(x=5) move position up;
>
> increment colour of pixel at position;
>
> Besides illustrating the unnecessary wordiness of even conventional
> pseudo-code, it fails to specify what happens for the cases where x has the
> values six through ten (and zero).
>
>   
You're right. This is my interpretation:

NB. nomove up   down right left   ..
dr=: 0 0, 0 1, 0 _1, 1 0, _1 0, 0 0, 0 0, 0 0, 0 0, 0 0,: 0 0

primenebulaP=: 3 : 0
  d=. ({.,#)/.~+/\ {&dr 11|p: i.y       NB. scan left +/ on movement steps
NB. normalize coordinates to upper right quadrant and calculate size
  'gx gy '=. >: >./ XY=.(2{."1 d) -"1 {.~&2 <./ d
  smoutput (": gx),' x ', ": gy         NB. show picture size
  viewmat (2{"1 d) (<"1 XY) } 0$~ gx, gy
)




> On Thu, Jan 7, 2010 at 11:39 AM, Aai <[email protected]> wrote:
>
>   
>> If you haven't this before: an intriguing picture of prime number
>> distribution.
>>
>> http://yoyo.cc.monash.edu.au/~bunyip/primes/2dPrimes.htm<http://yoyo.cc.monash.edu.au/%7Ebunyip/primes/2dPrimes.htm>
>>
>> --
>> Met vriendelijke groet,
>> =@@i
>>
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
>>     
>
>
>   

-- 
Met vriendelijke groet,
=@@i

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to