Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Spiraling integers

by ambrus (Abbot)
on Sep 10, 2005 at 21:40 UTC ( #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
Node Status?
node history
Node Type: note [id://490939]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2019-10-22 23:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?