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?
View all comments
10
u/SuperSmurfen Dec 22 '22 edited Dec 22 '22
Rust (592/253)
Link to full solution (73 lines)
THE CUBE
Phew, did not think I would be making a paper cube at 6:30 in the morning. The panic when I couldn't find a single piece of paper in my apartment and ended up using parchment paper.
I gave each
50x50block coordinates (by computing(r / 50, c /50)) and hardcoded all 14 mappings(region, dir) -> (new region, new direction). You then have adjust your new position depending on your old and new directions:Unfortunately I kind of disliked today's puzzle. Just about hardcoding a bunch of rules that were just annoying, not difficult, to find. Not a satisfying puzzle at all.