aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScimon <simon.proctor@gmail.com>2022-11-14 13:26:05 +0000
committerScimon <simon.proctor@gmail.com>2022-11-14 13:26:05 +0000
commita3a37f596f2e306493de2ecdf3d7311dfb53d93e (patch)
tree336653082b24e7dc53dafdc68af1b63edd360214
parent2d35fafadd17050147947061940098f238e5e6dd (diff)
downloadperlweeklychallenge-club-a3a37f596f2e306493de2ecdf3d7311dfb53d93e.tar.gz
perlweeklychallenge-club-a3a37f596f2e306493de2ecdf3d7311dfb53d93e.tar.bz2
perlweeklychallenge-club-a3a37f596f2e306493de2ecdf3d7311dfb53d93e.zip
Calculate 1-15 in the time it takes to do 15
-rw-r--r--challenge-191/simon-proctor/raku/ch-2.raku10
1 files changed, 6 insertions, 4 deletions
diff --git a/challenge-191/simon-proctor/raku/ch-2.raku b/challenge-191/simon-proctor/raku/ch-2.raku
index d6dfe05e9a..e790d9e2fb 100644
--- a/challenge-191/simon-proctor/raku/ch-2.raku
+++ b/challenge-191/simon-proctor/raku/ch-2.raku
@@ -2,8 +2,6 @@
subset ValidRange of Int where 0 < * <= 15;
subset LargeRange of Int where 9 < * <= 15;
-subset EmptyList of List where *.elems == 0;
-subset NonEmptyList of List where *.elems > 0;
#|( Given an int between 1 and 15 return the number of cute lists can be
made from the range 1..$n )
@@ -13,9 +11,13 @@ multi sub MAIN( ValidRange() $n ) {
#|( Prints the list of cute counts for all values between 1 and 15)
multi sub MAIN() {
- for ( 1..15 ) {
- say "$_ : {cute-count($_)}";
+ my @checks;
+ for (1..15) {
+ my $a = $_;
+ @checks.push( start { "$a : {cute-count($_)}" } );
}
+ await @checks;
+ say $_.result for @checks;
}
multi sub MAIN( "TEST" ) is hidden-from-USAGE {