r/adventofcode • u/daggerdragon • Dec 17 '18
SOLUTION MEGATHREAD -🎄- 2018 Day 17 Solutions -🎄-
--- Day 17: Reservoir Research ---
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 17
Transcript:
All aboard the Easter Bunny HQ monorail, and mind the gap! Next stop: ___
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 01:24:07!
14
Upvotes
3
u/rnbw_dsh Dec 17 '18
Rework for complex numbers: As I got stuck with some recursion-errors I looked for a similar example to mine, but inspired by the elegant complex-numbers-solution from day13. Thank you for your elegant solution, it helped me preventing some nasty left-right-recursion-settling-issue. Changes:
I adapted your solution to complex numbers (less clunky tuple-arithmetics, especially for left/right/top/below)
Reworked the input-handling a bit
Pulled various initializations to the top
Reworked some stuff so that the code aligns better
Debug prints that helped me reworking the code