]> www.fi.muni.cz Git - aoc.git/blobdiff - 2016/09.pl
Year 2016, days 1-10: so far pretty interesting
[aoc.git] / 2016 / 09.pl
diff --git a/2016/09.pl b/2016/09.pl
new file mode 100755 (executable)
index 0000000..6952777
--- /dev/null
@@ -0,0 +1,20 @@
+#!/usr/bin/perl -w
+
+use strict;
+use v5.30;
+
+use Digest::MD5 qw(md5_hex);
+
+my $id = 'ugkcyxxp';
+my $pass = '';
+my $i = 0;
+while (length($pass) < 8) {
+       my $h = md5_hex($id.$i);
+       if ($h =~ /\A00000/) {
+               $pass .= substr($h, 5, 1);
+       }
+       $i++;
+}
+
+say $pass;
+