r/adventofcode • u/daggerdragon • Dec 06 '19
SOLUTION MEGATHREAD -🎄- 2019 Day 6 Solutions -🎄-
--- Day 6: Universal Orbit Map ---
Post your solution using /u/topaz2078's paste or other external repo.
- Please do NOT post your full code (unless it is very short)
- If you do, use old.reddit's four-spaces formatting, NOT new.reddit's triple backticks formatting.
(Full posting rules are HERE if you need a refresher).
Reminder: Top-level posts in 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's Poems for Programmers
Note: If you submit a poem, please add [POEM] somewhere nearby to make it easier for us moderators to ensure that we include your poem for voting consideration.
Day 5's winner #1: "It's Back" by /u/glenbolake!
The intcode is back on day five
More opcodes, it's starting to thrive
I think we'll see more
In the future, therefore
Make a library so we can survive
Enjoy your Reddit Silver, and good luck with the rest of the Advent of Code!
View all comments
Show parent comment
1
u/vodak Dec 08 '19
I just realized that if you have an extra line break at the end of the input file, it will turn the first loop into an infinite one. I had deleted that line break from my file before writing the code... so my file ends like this:
"... XW6)NNM BCX)KB5 8WG)ZXM"
instead of like this:
"... XW6)NNM BCX)KB5 8WG)ZXM[line break] "
Try my original code after removing that line break (assuming you have that line break in your input file), and see that if fixes the issue(s).
Edit: the line breaks I'm entering into my comment aren't showing up, but I added "[line break]" to show exactly where I'm talking about.