diff options
Diffstat (limited to 'challenge-190')
| -rw-r--r-- | challenge-190/mark-anderson/raku/ch-1.raku | 2 | ||||
| -rw-r--r-- | challenge-190/mark-anderson/raku/ch-2.raku | 24 |
2 files changed, 1 insertions, 25 deletions
diff --git a/challenge-190/mark-anderson/raku/ch-1.raku b/challenge-190/mark-anderson/raku/ch-1.raku index 16b5ff297a..00301d78f5 100644 --- a/challenge-190/mark-anderson/raku/ch-1.raku +++ b/challenge-190/mark-anderson/raku/ch-1.raku @@ -8,5 +8,5 @@ ok capital-detection("raku"); sub capital-detection($s) { - any($s eq $s.tclc, $s eq $s.lc, $s eq $s.uc) + $s eq any($s.tclc, $s.lc, $s.uc) } diff --git a/challenge-190/mark-anderson/raku/ch-2.raku b/challenge-190/mark-anderson/raku/ch-2.raku deleted file mode 100644 index be1685915e..0000000000 --- a/challenge-190/mark-anderson/raku/ch-2.raku +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env raku -use Test; - -is-deeply decode-counts(11), < AA K >; -is-deeply decode-counts(1115), < AAAE AAO AKE KAE KO >; -is-deeply decode-counts(127), < ABG LG >; - -# Not sure how to deal with zeros but this is what the program does. -is-deeply decode-counts(1002001), < ABA ATA JBA JTA >; - -sub decode-counts($n) -{ - sub composition($_) - { - gather .fmt('%0' ~ $n.chars ~ 'b') ~~ m:g/(.)$0* <?{ take $/.pos - $/.from }>/ - } - - sort map - { - my $c := $n.comb.rotor(composition($_))>>.join>>.Int; - next unless all($c) ~~ 1..26; - [~] $c.map({ chr($_+64) }); - }, ^2**($n.chars-1) -} |
