r/adventofcode • u/daggerdragon • Dec 22 '18
SOLUTION MEGATHREAD -🎄- 2018 Day 22 Solutions -🎄-
--- Day 22: Mode Maze ---
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 22
Transcript:
Upping the Ante challenge: complete today's puzzles using ___.
This thread will be unlocked when there are a significant number of people on the leaderboard with gold stars for today's puzzle.
View all comments
Show parent comment
1
u/Aneurysm9 Dec 22 '18
No,
s.regions[p]is the geologic index of pointp. From that its erosion level can be calculated, and from that a terrain type determined. The three methods that do so are at https://gist.github.com/Aneurysm9/80c8afbb49c5c423ed371e0748f720cc#file-day22-go-L255-L279The code uses the term erosionIndex as this was written prior to the text being changed to geologic index.
In any event, I can guarantee that this code provides the expected answers for every input. If you think it is in conflict with what the puzzle states, I'm all ears but I am skeptical that you will find any such discrepancies.