]> www.fi.muni.cz Git - aoc.git/blob - 2016/09.pl
Day 25: examining the input
[aoc.git] / 2016 / 09.pl
1 #!/usr/bin/perl -w
2
3 use strict;
4 use v5.30;
5
6 use Digest::MD5 qw(md5_hex);
7
8 my $id = 'ugkcyxxp';
9 my $pass = '';
10 my $i = 0;
11 while (length($pass) < 8) {
12         my $h = md5_hex($id.$i);
13         if ($h =~ /\A00000/) {
14                 $pass .= substr($h, 5, 1);
15         }
16         $i++;
17 }
18
19 say $pass;
20