Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Re: Pascal triange...

by Burak (Chaplain)
on Dec 25, 2003 at 14:35 UTC ( #316981=note: print w/replies, xml ) Need Help??


in reply to Re: Pascal triange...
in thread Pascal's triangle...

Maybe we can add space padding to your function :)
sub pascal { my $max = shift or return; my @row = (0) x $max; $row[0] = 1; foreach (1 .. $max) { print " " x ($max - $_),"@row[0 .. $_ - 1]\n"; $row[$_] += $row[$_ - 1] for reverse 1 .. @row; } }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://316981]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2017-04-29 16:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (533 votes). Check out past polls.