In a recent Chatterbox discussion, the question was whether the Pascal triangle starts with row zero or one. This little script is to highlight why zero is the first row:
use strict; use warnings; my $n = 5; for (my $i=0; $i<=$n; ++$i ) { print " " x ($n-$i); print "/$i\\ " for 0..$i; print "\n"; print " " x ($n-$i); print "\\$_/ " for 0..$i; print "\n\n"; }
Back to
Cool Uses for Perl