aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-091/gugod/raku/ch-1.raku7
-rw-r--r--challenge-091/gugod/raku/ch-2.raku3
2 files changed, 3 insertions, 7 deletions
diff --git a/challenge-091/gugod/raku/ch-1.raku b/challenge-091/gugod/raku/ch-1.raku
index 4ce70b4d76..ed5592279a 100644
--- a/challenge-091/gugod/raku/ch-1.raku
+++ b/challenge-091/gugod/raku/ch-1.raku
@@ -1,15 +1,12 @@
-
sub MAIN (Int $N) {
+ # [1]
my @chars = $N.comb;
- # [1]
my Str $out;
-
- # [2] $i..$j
my $i = 0;
my $j = 0;
- # [3] invariant: @chars[$i..$j] eq (@chars[$i] x ($j - $i))
+ # [2] invariant: @chars[$i..$j] eq (@chars[$i] x ($j - $i))
while $j < @chars.elems {
$j++ while $j < @chars.elems && @chars[$i] eq @chars[$j];
diff --git a/challenge-091/gugod/raku/ch-2.raku b/challenge-091/gugod/raku/ch-2.raku
index a904142290..09b18af75d 100644
--- a/challenge-091/gugod/raku/ch-2.raku
+++ b/challenge-091/gugod/raku/ch-2.raku
@@ -1,8 +1,7 @@
sub play-jump-game (@N) {
- my Bool @reachable = @N.map({ False });
-
# [1]: $reachable[$i] = solution of the sub-problem: $i .. @N.end
+ my Bool @reachable = @N.map({ False });
@reachable[ @reachable.end ] = True;
# [2]: Solve the lightly bigger sub-problem each time