r/adventofcode • u/daggerdragon • Dec 22 '22
SOLUTION MEGATHREAD -π- 2022 Day 22 Solutions -π-
All of our rules, FAQs, resources, etc. are in our community wiki.
AoC Community Fun 2022:
πΏπ MisTILtoe Elf-ucation π§βπ«
23h59m remaining until submission deadline tonight at 23:59 EST!
Teach us, senpai!
UPDATES
[Update @ 00:19:04]: SILVER CAP, GOLD 0
Translator Elephant: "From what I understand, the monkeys have
most ofthe password to the force field!"You: "Great! Now we can
take every last breath of fresh air from Planet Druidiameet up with the rest of the elves in the grove! What's the combination?"Translator Elephant: "I believe they say it is
one two three four five."You: "
One two three four five?! That's amazing! I've got the same combination on my luggage!"Monkeys: *look guiltily at each other*
[Update @ 01:00:00]: SILVER CAP, GOLD 35
You: "What's the matter with this thing? What's all that churning and bubbling? You call that a
radar screenGrove Positioning System?"Translator Elephant: "No, sir. We call it..." *slaps machine* "... Mr.
CoffeeEggnog. Care for some?"You: "Yes. I always have eggnog when I watch GPS. You know that!"
Translator Elephant: "Of course I do, sir!"
You: "Everybody knows that!"
Monkeys: "Of course we do, sir!"
[Update @ 01:10:00]: SILVER CAP, GOLD 75
Santa: "God willing, we'll all meet again in
SpaceballsAdvent of Code 2023 : The Search for MoreMoneyStars."
--- Day 22: Monkey Map ---
Post your code solution in this megathread.
Read the full posting rules in our community wiki before you post!
Include what language(s) your solution uses
Format code blocks using the four-spaces Markdown syntax!
Quick link to Topaz's
pasteif you need it for longer code blocks. What is Topaz'spastetool?
5
u/mattbillenstein Dec 22 '22 edited Dec 22 '22
Python https://github.com/mattbillenstein/aoc/blob/main/2022/22/p2.py
Ok, part 1 went pretty fast, easy peasy.
Part 2, I'm kinda proud of how good I did mucking this one up - I did like any noob and wrote up all the edge connections for the test case, then when I found the input was in a different shape (WTF!) I was like, I don't wanna do that again, I'll just translate the input data into the shape of the test data....
So a couple hours of mucking around and figuring out I had flipped one side about X when it should have been about Y, and everything is working nice, but my results are still off... Several hours further on, I realize when I'm computing the password, I hadn't backed out the translation I did to the original input coordinates; so I do that bit by hand and wham, success.
If you want to look at some of the hilarity:
https://raw.githubusercontent.com/mattbillenstein/aoc/main/2022/22/input-check.txt
and
https://raw.githubusercontent.com/mattbillenstein/aoc/main/2022/22/input-check.out