adventofcode/2017/05/maze2.pl
2017-12-28 12:15:15 -05:00

14 lines
213 B
Raku

my @maze = <>;
my $position = 0;
my $steps = 0;
my $p;
while( $position < @maze ) {
$steps++;
my $i = $position;
$position += $p = $maze[$position];
$maze[$i] += $p > 2 ? -1 : 1;
}
print $steps;