aboutsummaryrefslogtreecommitdiff
path: root/challenge-033/dave-cross/perl5/ch-2.pl
blob: 15ab4aa13647bc4bb84c7151d535835445564f3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/perl

use strict;
use warnings;
use feature 'say';

say '  x|', map { sprintf '%4s', $_ } 1 .. 11;
say '---+', '-' x 44;

for my $x (1 .. 11) {
  printf '%3s|', $x;
  for my $y (1 .. 11) {
    printf '%4s', ($x > $y ? '' : $x * $y);
  }
  print "\n";
}