diff options
| author | Mark Anderson <mark@frontrangerunner.com> | 2020-06-05 21:47:20 -0600 |
|---|---|---|
| committer | Mark Anderson <mark@frontrangerunner.com> | 2020-06-05 21:47:20 -0600 |
| commit | d4ab722f2432ec0cce5c3ce7ec68fc89e3ee0434 (patch) | |
| tree | 9fedd841680e1a531701d288b2a1696f90bbe523 /challenge-063 | |
| parent | 780cd706fbfb79f67846c55e4b2bb3b213bf58e6 (diff) | |
| download | perlweeklychallenge-club-d4ab722f2432ec0cce5c3ce7ec68fc89e3ee0434.tar.gz perlweeklychallenge-club-d4ab722f2432ec0cce5c3ce7ec68fc89e3ee0434.tar.bz2 perlweeklychallenge-club-d4ab722f2432ec0cce5c3ce7ec68fc89e3ee0434.zip | |
Challenge 63 Solutions
Diffstat (limited to 'challenge-063')
| -rw-r--r-- | challenge-063/mark-anderson/raku/ch-1.raku | 2 | ||||
| -rw-r--r-- | challenge-063/mark-anderson/raku/ch-2.raku | 1 |
2 files changed, 1 insertions, 2 deletions
diff --git a/challenge-063/mark-anderson/raku/ch-1.raku b/challenge-063/mark-anderson/raku/ch-1.raku index 5affbfd16d..22c8fb26e2 100644 --- a/challenge-063/mark-anderson/raku/ch-1.raku +++ b/challenge-063/mark-anderson/raku/ch-1.raku @@ -7,6 +7,6 @@ say last_word(join(' ', 1..1e6), rx/^(3.*?)**3/); sub last_word(Str $string, Regex $regexp) { - return $string.split(/\s+/).grep($regexp).Array.pop || Nil; + return $string.words.grep($regexp).Array.pop || Nil; } diff --git a/challenge-063/mark-anderson/raku/ch-2.raku b/challenge-063/mark-anderson/raku/ch-2.raku index f8d58772c3..fc8033a34c 100644 --- a/challenge-063/mark-anderson/raku/ch-2.raku +++ b/challenge-063/mark-anderson/raku/ch-2.raku @@ -4,7 +4,6 @@ sub MAIN(Str $str = "xyxx") { my @arr = $str.comb; for 1 .. Inf -> $i { - next if $i %% $str.chars; @arr .= rotate($i % $str.chars); say $i and last if @arr.join eq $str; } |
