Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: Diamonds for fun

by a (Friar)
on Mar 06, 2011 at 00:15 UTC ( #891626=note: print w/ replies, xml ) Need Help??


in reply to Re: Diamonds for fun
in thread Diamonds for fun

Had to:

perl -e '$n=pop; print "\n", " "x($n-$_),1..$_,reverse 1..$_-1, for 1. +.$n,reverse 1..$n-1' 9
for 5.8 ish ... seems like there's a marvelous recursive solution but my brain is too small to find it.

a


Comment on Re^2: Diamonds for fun
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2016-02-14 16:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?





    Results (470 votes), past polls