Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
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 scrutinizing the Monastery: (8)
As of 2019-02-22 09:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I use postfix dereferencing ...









    Results (117 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!