aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-044/simon-proctor/raku/ch-1.p64
1 files changed, 2 insertions, 2 deletions
diff --git a/challenge-044/simon-proctor/raku/ch-1.p6 b/challenge-044/simon-proctor/raku/ch-1.p6
index 5ec6641727..d99c7836bd 100644
--- a/challenge-044/simon-proctor/raku/ch-1.p6
+++ b/challenge-044/simon-proctor/raku/ch-1.p6
@@ -3,7 +3,7 @@
use v6.d;
multi sub concat( \a, \b ) { a ~ b }
-multi sub concat( \a, @b ) { ( a ~ @b[0], @b[1..*] ) }
+multi sub concat( @a, \b ) { ( @a[0..*-2], @a[*-1] ~ b ) }
my %ops-map = (
'+' => &infix:<+>,
@@ -36,7 +36,7 @@ multi sub apply-ops( @list where *.elems == 2, @ops ) {
}
multi sub apply-ops( @list, @ops ) {
- return @ops[0](@list[0],apply-ops( @list[1..*], @ops[1..*] ) );
+ return @ops[*-1](apply-ops( @list[0..*-2], @ops[0..*-2] ), @list[*-1] );
}
sub display( @nums, @ops ) {