diff options
| author | holli-holzer <holli.holzer@gmail.com> | 2020-01-22 01:36:32 +0100 |
|---|---|---|
| committer | holli-holzer <holli.holzer@gmail.com> | 2020-01-22 01:36:32 +0100 |
| commit | e1a2f4a3bd171c4931ddd3875a764466d71e70a5 (patch) | |
| tree | 105d7c5b5bd18ee0d90b32b9d746496f00ccdec8 /challenge-044/markus-holzer | |
| parent | fd139f1813e872bbe9af82c510a719a7a143f206 (diff) | |
| download | perlweeklychallenge-club-e1a2f4a3bd171c4931ddd3875a764466d71e70a5.tar.gz perlweeklychallenge-club-e1a2f4a3bd171c4931ddd3875a764466d71e70a5.tar.bz2 perlweeklychallenge-club-e1a2f4a3bd171c4931ddd3875a764466d71e70a5.zip | |
Moved gather to a better place
Diffstat (limited to 'challenge-044/markus-holzer')
| -rw-r--r-- | challenge-044/markus-holzer/raku/ch-1.p6 | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/challenge-044/markus-holzer/raku/ch-1.p6 b/challenge-044/markus-holzer/raku/ch-1.p6 index 73dac94fd7..bc16e7da57 100644 --- a/challenge-044/markus-holzer/raku/ch-1.p6 +++ b/challenge-044/markus-holzer/raku/ch-1.p6 @@ -1,8 +1,8 @@ -.say for ( gather candidates( "123456789" ) ).grep: *.sum == 100; +.say for candidates( "123456789" ).grep: *.sum == 100; sub candidates( $str ) { - for 1..^($str.chars) -> $l + gather for 1..^($str.chars) -> $l { my $i = $str.substr( 0, $l ).Int; my $j = $str.substr( $l, * ).Int; @@ -11,7 +11,7 @@ sub candidates( $str ) { take [ $i * $f, $j ]; take [ $i * $f, $j * -1 ]; - take [ $i * $f, |$_ ] for gather candidates( $j.Str ); + take [ $i * $f, |$_ ] for candidates( $j.Str ); } } } |
