Multiplication tables: Difference between revisions

Line 304:
our $width = length($max**2) + 1;
 
printf "%${width}*s", $width, $_ foreach 'x|', 1..$max;
print "\n", '-' x ($width - 1), '+', '-' x ($max*$width), "\n";
foreach my $i (1..$max) {
printf "%${width}*s", $width, $_
foreach "$i|", map { $_ >= $i and $_*$i } 1..$max;
print "\n";
Anonymous user