diff options
| author | Markus "Holli" Holzer <holli.holzer@gmail.com> | 2020-02-08 06:37:33 +0100 |
|---|---|---|
| committer | Markus "Holli" Holzer <holli.holzer@gmail.com> | 2020-02-08 06:37:33 +0100 |
| commit | d7eb145b5eda43057ac7c97cc482546b41e7616a (patch) | |
| tree | 3a833ee01c5661c0d308b74d39fc548f79a6d988 /challenge-046 | |
| parent | 6e3ffc32e2c3e4ebff49d101e21ff79b2ab29695 (diff) | |
| download | perlweeklychallenge-club-d7eb145b5eda43057ac7c97cc482546b41e7616a.tar.gz perlweeklychallenge-club-d7eb145b5eda43057ac7c97cc482546b41e7616a.tar.bz2 perlweeklychallenge-club-d7eb145b5eda43057ac7c97cc482546b41e7616a.zip | |
Improved solution #2
Diffstat (limited to 'challenge-046')
| -rw-r--r-- | challenge-046/markus-holzer/raku/ch-2.p6 | 8 |
1 files 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 ) { |
