That is a nice tacit solution; a slower but leaner variation follows:
spiral=. $ /:@:(*/ {. }:@:(0&({::)@:((([ , {.@:]) ;
|.@:|:@:}.@:])&>/^:_))@:(''&;)@:i.)
s=. s f.
(s -: spiral)300 200
1
st's 200 300'
+--------+--------+
|53149952|0.368337|
+--------+--------+
st'spiral 200 300'
+-------+--------+
|5246208|0.654777|
+-------+--------+
> [EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
>
> Well put. Let's see if I can unravel this mystery:
>
> onion =: [: ((0 -.@:e. $)&> # {.&.>) |.@:|:@:}.&.>^:a: @: <
> s =: $ /:@;@(onion)@i. NB. onion is a verb, so no <
>
> s 4 5
> 0 1 2 3 4
> 13 14 15 16 5
> 12 19 18 17 6
> 11 10 9 8 7
>
> <snip terrible pun>
>
> -Dan
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm