diff options
| author | BarrOff <58253563+BarrOff@users.noreply.github.com> | 2023-03-06 00:16:10 +0100 |
|---|---|---|
| committer | BarrOff <58253563+BarrOff@users.noreply.github.com> | 2023-03-06 00:16:10 +0100 |
| commit | 91fefeb6a999d347cb8d545fae3d659801c6b875 (patch) | |
| tree | 600dbb21e8edd81c93e08b751dd542b49961ae35 | |
| parent | 18086c67c1583352041b964491b7dd54381302cb (diff) | |
| download | perlweeklychallenge-club-91fefeb6a999d347cb8d545fae3d659801c6b875.tar.gz perlweeklychallenge-club-91fefeb6a999d347cb8d545fae3d659801c6b875.tar.bz2 perlweeklychallenge-club-91fefeb6a999d347cb8d545fae3d659801c6b875.zip | |
style: format expressions to better fit linewidth
| -rw-r--r-- | challenge-206/barroff/raku/ch-1.raku | 12 | ||||
| -rw-r--r-- | challenge-206/barroff/raku/ch-2.raku | 5 |
2 files changed, 12 insertions, 5 deletions
diff --git a/challenge-206/barroff/raku/ch-1.raku b/challenge-206/barroff/raku/ch-1.raku index cb269c58e2..c7aa19b521 100644 --- a/challenge-206/barroff/raku/ch-1.raku +++ b/challenge-206/barroff/raku/ch-1.raku @@ -9,7 +9,8 @@ constant $time-format = / /; sub convert-to-minutes(Str $time --> Int) { - $time ~~ $time-format or die "Time string not in the right format.\nExpected 'HH:MM' but got $time"; + $time ~~ $time-format or + die "Time string not in the right format.\nExpected 'HH:MM' but got $time"; $<hours> × 60 + $<minutes>; } @@ -30,9 +31,12 @@ multi sub MAIN('test') { use Test; plan 3; - is shortest-time(Array[Str].new(["00:00", "23:55", "20:00"])), 5, 'works for ("00:00", "23:55", "20:00")'; - is shortest-time(Array[Str].new(["01:01", "00:50", "00:57"])), 4, 'works for ("01:01", "00:50", "00:57")'; - is shortest-time(Array[Str].new(["10:10", "09:30", "09:00", "09:55"])), 15, 'works for ("10:10", "09:30", "09:00", "09:55")'; + is shortest-time(Array[Str].new(["00:00", "23:55", "20:00"])), 5, + 'works for ("00:00", "23:55", "20:00")'; + is shortest-time(Array[Str].new(["01:01", "00:50", "00:57"])), 4, + 'works for ("01:01", "00:50", "00:57")'; + is shortest-time(Array[Str].new(["10:10", "09:30", "09:00", "09:55"])), 15, + 'works for ("10:10", "09:30", "09:00", "09:55")'; } #| Take user provided list like 1 2 2 3 diff --git a/challenge-206/barroff/raku/ch-2.raku b/challenge-206/barroff/raku/ch-2.raku index 916f1adc0d..bf9c4f42f0 100644 --- a/challenge-206/barroff/raku/ch-2.raku +++ b/challenge-206/barroff/raku/ch-2.raku @@ -18,7 +18,10 @@ multi sub MAIN('test') { } #| Take user provided list like 1 2 2 3 -multi sub MAIN(*@elements where @elements.elems ≥ 2 && @elements.elems % 2 == 0 && all(@elements) ~~ /^<[+-]>?<[0..9]>+$/) { +multi sub MAIN(*@elements where + @elements.elems ≥ 2 && + all(@elements) % 2 == 0 && + all(@elements) ~~ /^<[+-]>?<[0..9]>+$/) { my Int @int-elements = @elements; say array-pairings(@int-elements); } |
