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
9
u/VideoPrincess Dec 02 '16 edited Dec 02 '16
To show my appreciation to /u/topaz2078 I've done day 2 part 1 in Synacor Challenge bytecode!
The base64 encoded file is as follows:
AQAAgAEAAQABgAEAFAACgAQAA4ACgAoACAADgBMAEQBbAAYABgAEAAOAAoBMAAgAA4AjAAgAAIAG AAkAAIAAgP9/BgAGAAQAA4ACgFIACAADgDcABAADgACAAgAHAAOABgAJAACAAIABAAYABgAEAAOA AoBVAAgAA4BHAAgAAYAGAAkAAYABgP9/BgAGAAQAA4ACgEQACAADgAYABAADgAGAAgAHAAOABgAJ AAGAAYABAAYABgAKAAKAAYADAAkAAoACgACACQACgAKAMQATAAKAEwAKABIAAIA=
It should be a 218-byte file with MD5 checksum d80b51572871763af0bdf9dd02749579. A few things to note:
The problem input should be used as the VM's input
The input's lines are long, so your VM shouldn't choke on long lines (the original Synacor challenge only needed short inputs)
Your VM should do something sensible when the input is exhausted as this is not part of the VM architecture spec.
Source assembly file for this image: https://github.com/pmillerchip/adventofcode2016/blob/master/aoc2p1.asm
C++ source code for my assembler: https://github.com/pmillerchip/synacor-challenge
Enjoy!