diff options
| author | Mohammad S Anwar <Mohammad.Anwar@yahoo.com> | 2020-02-08 07:54:59 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-08 07:54:59 +0000 |
| commit | 0e4204d852c7bf58b693a56d686928f309fae22a (patch) | |
| tree | e2b51508de13329fa7122490679bdb3dca7a0e87 | |
| parent | 80bb58ec96e9a5469afcf4c0be1f4f6bbce57aa6 (diff) | |
| parent | 5245b91394c619ff405b3659346088620ccd32aa (diff) | |
| download | perlweeklychallenge-club-0e4204d852c7bf58b693a56d686928f309fae22a.tar.gz perlweeklychallenge-club-0e4204d852c7bf58b693a56d686928f309fae22a.tar.bz2 perlweeklychallenge-club-0e4204d852c7bf58b693a56d686928f309fae22a.zip | |
Merge pull request #1223 from holli-holzer/master
Final. I promise ;-)
| -rw-r--r-- | challenge-046/markus-holzer/raku/ch-1.p6 | 8 | ||||
| -rw-r--r-- | challenge-046/markus-holzer/raku/ch-2.p6 | 6 |
2 files changed, 5 insertions, 9 deletions
diff --git a/challenge-046/markus-holzer/raku/ch-1.p6 b/challenge-046/markus-holzer/raku/ch-1.p6 index 2cc9eca2ca..5495b8b625 100644 --- a/challenge-046/markus-holzer/raku/ch-1.p6 +++ b/challenge-046/markus-holzer/raku/ch-1.p6 @@ -13,8 +13,8 @@ say decrypt( $message ); sub decrypt( $encrypted ) { [~] zip( - $encrypted.lines.map({ .split(/ \s /) }) - ).map({ - .Bag.first({ .value > 1 }).key - }); + $encrypted.lines.map: *.words + ).map( + *.Bag.maxpairs[0].key + ); }
\ No newline at end of file diff --git a/challenge-046/markus-holzer/raku/ch-2.p6 b/challenge-046/markus-holzer/raku/ch-2.p6 index 0923f3e2a5..c804e864ab 100644 --- a/challenge-046/markus-holzer/raku/ch-2.p6 +++ b/challenge-046/markus-holzer/raku/ch-2.p6 @@ -19,10 +19,6 @@ say "Open rooms: ", join ',', ( 1..500 ).grep: *.&is-open; -sub is-open( $room ) -{ - my $sqrt = $room.sqrt; - $sqrt == $sqrt.Int -} +sub is-open( $room ) { ($_ = $room.sqrt) && $_ == $_.Int; } # Open rooms: 1,4,9,16,25,36,49,64,81,100,121,144,169,196,225,256,289,324,361,400,441,484
\ No newline at end of file |
