Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Spiraling integers

by blokhead (Monsignor)
on Aug 28, 2005 at 21:03 UTC ( #487312=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub f {
    #234567890123456789012345678901234567890123456789012345678901234567890
    +12345678901
    my$x=my$i=pop;$x?([1..$x],map[(map$_+2*$x-1,reverse@$_),++$i],reverse 
    +f($x-1)):()
    }
    
  2. or download this
    ## print "@$_\n" for f(5);
    1 2 3 4 5
    ...
    15 24 25 20 7
    14 23 22 21 8
    13 12 11 10 9
    
  3. or download this
     +---------------+
     | 1 2 3 ...  n  |
    ...
     | |       |  .  |
     | +-------+ 2n-1|
     +---------------+
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2019-09-16 08:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The room is dark, and your next move is ...












    Results (186 votes). Check out past polls.

    Notices?