aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-046/markus-holzer/raku/ch-1.p68
-rw-r--r--challenge-046/markus-holzer/raku/ch-2.p66
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