diff options
| author | Jörg Sommrey <28217714+jo-37@users.noreply.github.com> | 2023-03-26 18:26:57 +0200 |
|---|---|---|
| committer | Jörg Sommrey <28217714+jo-37@users.noreply.github.com> | 2023-04-19 17:15:35 +0200 |
| commit | 35201c7b6705a85b815ffc13a77f425ce70c97b7 (patch) | |
| tree | ba18f100e97cd3a368e04fc4c406e6c521ab1f2c /challenge-033 | |
| parent | c422882aed45b070d14feb72cd38637c66feadcf (diff) | |
| download | perlweeklychallenge-club-35201c7b6705a85b815ffc13a77f425ce70c97b7.tar.gz perlweeklychallenge-club-35201c7b6705a85b815ffc13a77f425ce70c97b7.tar.bz2 perlweeklychallenge-club-35201c7b6705a85b815ffc13a77f425ce70c97b7.zip | |
Challenge 033 task 2
Diffstat (limited to 'challenge-033')
| -rwxr-xr-x | challenge-033/jo-37/perl/ch-2.pl | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/challenge-033/jo-37/perl/ch-2.pl b/challenge-033/jo-37/perl/ch-2.pl new file mode 100755 index 0000000000..8a25d9775f --- /dev/null +++ b/challenge-033/jo-37/perl/ch-2.pl @@ -0,0 +1,14 @@ +#!/usr/bin/perl + +use v5.16; +use warnings; + +main: { + my @num = 1 .. 11; + my $fmt = "%4.0d" x @num; + printf " x|$fmt\n", @num; + print "---+" . "-" x (4 * @num) . "\n"; + for my $x (@num) { + printf "%3d|$fmt\n", $x, map +($_ >= $x) * $_ * $x, @num; + } +} |
