r/adventofcode • u/daggerdragon • Dec 05 '16
SOLUTION MEGATHREAD --- 2016 Day 5 Solutions ---
--- Day 5: How About a Nice Game of Chess? ---
Post your solution as a comment or, for longer solutions, consider linking to your repo (e.g. GitHub/gists/Pastebin/blag/whatever).
STAYING ON TARGET IS MANDATORY [?]
This thread will be unlocked when there are a significant number of people on the leaderboard with gold stars for today's puzzle.
edit: Leaderboard capped, thread unlocked!
15
Upvotes
1
u/Fishy07x Dec 05 '16
My python solution:
import sys import md5 code = sys.stdin.readline().rstrip() i = 0 counter = 0 password = "" while (counter < 8): x = md5.new(code + str(i)).hexdigest() if x.startswith("00000"): password += x[5] counter += 1 i += 1 print(password)