From d7eb145b5eda43057ac7c97cc482546b41e7616a Mon Sep 17 00:00:00 2001 From: "Markus \"Holli\" Holzer" Date: Sat, 8 Feb 2020 06:37:33 +0100 Subject: Improved solution #2 --- challenge-046/markus-holzer/raku/ch-2.p6 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/challenge-046/markus-holzer/raku/ch-2.p6 b/challenge-046/markus-holzer/raku/ch-2.p6 index 847eca2989..3a740aa9c7 100644 --- a/challenge-046/markus-holzer/raku/ch-2.p6 +++ b/challenge-046/markus-holzer/raku/ch-2.p6 @@ -12,12 +12,12 @@ # In the case of a square number however, there is always one pair for which both elements are the same. # 16 for example, has the divisor pairs are (1,16), (2, 8) and (4,4). # This last pair contains the same number twice. -# And that is what makes the total number of divisors odd -# And that is what tells us the door 16 will be open. +# And that is what makes the total number of divisors odd. +# And then that is what tells us the door 16 will be open. # -# Knowing all that we can solve by +# Thus we can solve by -say "Open rooms: \n", (1..^500).grep({ .&is-open }) .join(", "); +say "Open rooms: ", join ',', ( 1..^500 ).grep: *.&is-open; sub is-open( $room ) { -- cgit