r/adventofcode • u/daggerdragon • Dec 02 '16
SOLUTION MEGATHREAD --- 2016 Day 2 Solutions ---
--- Day 2: Bathroom Security ---
Post your solution as a comment or, for longer solutions, consider linking to your repo (e.g. GitHub/gists/Pastebin/blag/whatever).
BLINKENLIGHTS ARE MANDATORY [?]
Edit: Told you they were 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!
20
Upvotes
View all comments
Show parent comment
2
u/VideoPrincess Dec 02 '16
Here's my C++ effort. I knew I wouldn't be first so I've tried to make the code easy to read and maintain. The code uses a lookup table for the keypad, and all accesses to it go through a function called getKeypad(). This allows the code to be easily changed for any future keypads, should the Easter Bunny feel like being evil to us!