]> www.fi.muni.cz Git - aoc.git/blob - 2017/34.pl
Day 25: examining the input
[aoc.git] / 2017 / 34.pl
1 #!/usr/bin/perl
2
3 use v5.30;
4 use strict;
5
6 my $in = 345;
7
8 my $pos = 0;
9 my $val;
10 for (1 .. 50_000_000) {
11         $pos += $in;
12         if ($_ > 1) {
13                 $pos %= $_;
14         } else {
15                 $pos = 0;
16         }
17         $pos++;
18         $val = $_ if $pos == 1;
19 }
20
21 say $val;
22