http://www.perlmonks.org?node_id=316981


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; } }