diff options
| author | Mark <53903062+andemark@users.noreply.github.com> | 2022-02-28 19:35:26 +0000 |
|---|---|---|
| committer | Mark <53903062+andemark@users.noreply.github.com> | 2022-02-28 19:35:26 +0000 |
| commit | 63bb86f20a65e318a416a0a478eaecf60faf8251 (patch) | |
| tree | d6c225d7e15f03a4411b31391fbff834f8b7be24 | |
| parent | 708f0b09a688c48e140d552c4116678099bb0581 (diff) | |
| download | perlweeklychallenge-club-63bb86f20a65e318a416a0a478eaecf60faf8251.tar.gz perlweeklychallenge-club-63bb86f20a65e318a416a0a478eaecf60faf8251.tar.bz2 perlweeklychallenge-club-63bb86f20a65e318a416a0a478eaecf60faf8251.zip | |
Challenge 154 Solutions (Raku)
| -rw-r--r-- | challenge-154/mark-anderson/raku/ch-1.raku | 13 | ||||
| -rw-r--r-- | challenge-154/mark-anderson/raku/ch-2.raku | 5 |
2 files changed, 18 insertions, 0 deletions
diff --git a/challenge-154/mark-anderson/raku/ch-1.raku b/challenge-154/mark-anderson/raku/ch-1.raku new file mode 100644 index 0000000000..9a70bc672a --- /dev/null +++ b/challenge-154/mark-anderson/raku/ch-1.raku @@ -0,0 +1,13 @@ +#!/usr/bin/env raku + +use Test; + +my $list := <PELR PREL PERL PRLE PLER PLRE EPRL EPLR ERPL + ERLP ELPR ELRP RPEL RPLE REPL RELP RLPE RLEP>; + +is-deeply missing-permutations($list), set <LERP LPER LPRE LEPR LRPE LREP>; + +sub missing-permutations($list) +{ + $list.head.comb.permutations>>.join (-) $list; +} diff --git a/challenge-154/mark-anderson/raku/ch-2.raku b/challenge-154/mark-anderson/raku/ch-2.raku new file mode 100644 index 0000000000..20e87063f1 --- /dev/null +++ b/challenge-154/mark-anderson/raku/ch-2.raku @@ -0,0 +1,5 @@ +#!/usr/bin/env raku + +say .grep(*.is-prime).skip.head(10) with + +1, 1, 1, -> $a, $b, $ { $a + $b } ... *; |
