From a3a37f596f2e306493de2ecdf3d7311dfb53d93e Mon Sep 17 00:00:00 2001 From: Scimon Date: Mon, 14 Nov 2022 13:26:05 +0000 Subject: Calculate 1-15 in the time it takes to do 15 --- challenge-191/simon-proctor/raku/ch-2.raku | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'challenge-191') 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 { -- cgit