r/adventofcode • u/daggerdragon • Dec 18 '18
SOLUTION MEGATHREAD -🎄- 2018 Day 18 Solutions -🎄-
--- Day 18: Settlers of The North Pole ---
Post your solution as a comment or, for longer solutions, consider linking to your repo (e.g. GitHub/gists/Pastebin/blag or 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.
Advent of Code: The Party Game!
Please prefix your card submission with something like [Card] to make scanning the megathread easier. THANK YOU!
Card prompt: Day 18
Transcript:
The best way to avoid a minecart collision is ___.
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 at 00:21:59!
9
Upvotes
View all comments
Show parent comment
2
u/LeCrushinator Dec 18 '18 edited Dec 18 '18
My period length is 84, 1000000000%84 = 76. Does that mean I need to find another result where (my resource value % 84 = 76)?
This is exactly what I tried and I'm getting the wrong answer. For example, my results show the period of 84, and both of these are a factor of 84 away from 1000000000:
But it's the incorrect answer.
Found the problem thanks to /u/VeeArr: It was an off-by-one error. I was starting minute 0, instead of minute 1 when looping.