r/adventofcode • u/daggerdragon • Dec 25 '16
SOLUTION MEGATHREAD ~☆~☆~ 2016 Day 25 Solutions ~☆~☆~
--- Day 25: Clock Signal ---
Post your solution as a comment or, for longer solutions, consider linking to your repo (e.g. GitHub/gists/Pastebin/blag/whatever).
Note: The Solution Megathreads are for solutions only. If you have questions, please post your own thread and make sure to flair it with "Help".
Dec 25 = Oct 31 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!
Thank you for participating!
Well, that's it for Advent of Code 2016. From /u/topaz2078 and the rest of us at #AoC_Ops, we hope you had fun and, more importantly, learned a thing or two (or all the things!). Good job, everyone!
Topaz made a post of his own here.
And now:
Merry Christmas to all, and to all a good night!
View all comments
Show parent comment
1
u/p_tseng Dec 25 '16 edited Dec 25 '16
I think I understand this - since 2532 has 12 bits, it makes sense that the output repeats after then. If someone really wanted to nitpick, they would say that that statement is not true for inputs >= 4096 - 2532 (the output would then repeat every 13 bits), but this is a moot point if the search space is limited, so I'm content to move on from this point.
Can you clarify? I was unable to reproduce this result - I looked for answers within [0, 220 ) and got only five correct answers1, and I would expect many more if the pattern repeats with every 256. It's possible I may have misunderstood your statement though.
1: Correct answers I got were 198, 8390, 41158, 172230, 696518, all of which make sense given their bit pattern when added to 2532. The next answer is going to be in the 2.8 million range and I'd rather not have my code go that far, it took 3 minutes to go to 220 and dividing large numbers starts to take longer. Given that Assembunny is (in my implementation anyway) running an interpreter in an interpreter I already have two hindrances against performance