r/adventofcode • • 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!

13 Upvotes

188 comments sorted by

View all comments

Show parent comment

1

u/VideoPrincess Dec 05 '16

Oh that makes total sense now. Impressive, and thank you very much for explaining it!

For printing hex I made a mask bit and walked it up through the number using MULT by 2 each time, pushing each bit onto the stack. Then I popped bits off 4 at a time to assemble a nibble and print it. With a working right-shifter that becomes a whole lot easier!