]> www.fi.muni.cz Git - aoc.git/blob - 2017/09.pl
Day 25: examining the input
[aoc.git] / 2017 / 09.pl
1 #!/usr/bin/perl
2
3 use v5.30;
4 use strict;
5
6
7 my $pc = 0;
8 chomp (my @offs = <>);
9
10 my $steps = 0;
11 while ($pc >= 0 && $pc < @offs) {
12         say "$steps $pc $offs[$pc]";
13         $pc += $offs[$pc]++;
14         $steps++;
15 }
16
17 say $steps;