From d72e57d649d992caff11d2b6c613f57784eea42e Mon Sep 17 00:00:00 2001 From: Kang-min Liu Date: Fri, 18 Dec 2020 12:09:50 +0900 Subject: tweak comments --- challenge-091/gugod/raku/ch-1.raku | 7 ++----- challenge-091/gugod/raku/ch-2.raku | 3 +-- 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 -- cgit