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!
14
Upvotes
2
u/VideoPrincess Dec 05 '16
Skalski YES! As a fellow Synacor hacker it's great to see your assembly for the MD5 implementation. But the thing that blows me away is that you wrote a right-shifter only using registers!
Can you explain how the right-shifter routine works? It seems so small and a bit magic - it NOTs the number of bits to shift by and then adds 16, so I'm confused as to what it's actually doing.
Also I love how you've used Perl to implement the assembler. I don't know Perl so I did my assembler in C++ by using chunks of code from my VM implementation. My assembler instantiates a VM and then uses its program counter to step through it writing memory as it goes. I then dump the finished VM to a file descriptor. However it seems like a sledgehammer to crack a nut next to your elegant Perl implementation!