blob: 15f29a176e5d8fd81923dda7e9020d61a69baccd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#! /usr/bin/env raku
sub MAIN (:$verbose, *@strings)
{
@strings = ('I L O V E Y O U', '2 4 0 3 2 0 1 9', '! ? £ $ % ^ & *') unless @strings.elems;
my @arrays = @strings.map(*.words.List);
my $length = @arrays>>.elems.max;
my @width = @arrays>>.chars>>.max;
if $verbose
{
say ":A: { @arrays.perl }";
say ":L: $length";
say ":W: { @width }";
}
for ^$length -> $index
{
my $col = 0;
for @arrays
{
print "{ ($_[$index] // '').fmt("%-{ @width[$col] }s") } ";
$col++;
}
say "";
}
}
|