Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Spiraling integers

by ambrus (Abbot)
on Sep 10, 2005 at 21:40 UTC ( [id://490939]=note: print w/replies, xml ) Need Help??


in reply to Spiraling integers

Yet another J solution. This one has two functions that mutually recursively build the spiral. This one too accepts the size of the spiral as argument.

spiralh =: (,:@i. , ] + [: |:@|. spirals) ` ((1 0$0)"_) @. (<:&0) spirals =: ,:@i. , ] + [: |:@|. [: spiralh <: spiral =: ([: >: spirals)"0 2!:55[0[ 1!:2&2 spiral 5".>{: ARGV

This is getting addictive, isn't it?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://490939]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-04-24 22:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found