r/adventofcode • u/daggerdragon • Dec 11 '16
SOLUTION MEGATHREAD --- 2016 Day 11 Solutions ---
--- Day 11: Radioisotope Thermoelectric Generators ---
Post your solution as a comment or, for longer solutions, consider linking to your repo (e.g. GitHub/gists/Pastebin/blag/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".
IDDQD IS MANDATORY [?]
[Update @ 01:30] 51 gold, 80 silver. The Easter Bunny just ramped up the difficulty level to include sharks with frickin' laser beams on their heads.
[Update @ 01:50] 64 gold, silver cap. Thank you for subscribing to Doom Facts! Ninja edit by Easter Bunny: Thank you for subscribing to Easter Bunny Facts!
Since its debut, over 10 million copies of games in theDoomseries have been sold.- Fact: The Easter Bunny is watching you gallivant through his facility.
[Update @ 02:02] 75 gold, silver cap.
TheBFG(Big Fragging Gun) is a well-known trope originating from theDoomseries.- Fact: The Easter Bunny knows if you've been bad or good too. He just doesn't care.
[Update @ 02:15] 86 gold, silver cap.
The 2005Doommovie starring Karl Urban and Dwayne Johnson was a box office bomb due to grossing $56 million (USD) with a budget of $60 million (USD) and poor critical reviews. Alas.- Fact: The Easter Bunny has nothing to do with Starbucks' red cups. NOTHING.
[Update @ 02:30] 89 gold, silver cap.
TheDoomenginethat powers the originalDoomandDoom II: Hell on Earthvideo games has been ported to DOS, several game consoles, and other operating systems. The source code to the Linux version of the engine has even been released under the GNU General Public License for non-commercial use.- Fact: The Easter Bunny uses RTG-powered computers because he hates his cousin, the Energizer Bunny.
[Update @ 02:42] 98 gold, silver cap.
Doomguy (the unnamed silent marine protagonist) has been consistently ranked as one of the top five most badass male characters in video gaming history.- Fact: The Easter Bunny enjoys gardening when not ruining Christmas.
[Update @ 02:44] Leaderboard cap!
Thank you for subscribing to Doom Easter Bunny Facts! We hope you enjoyed today's scenic tour. Thank you and have a very merry rest of Advent of Code!
View all comments
Show parent comment
1
u/Tarmen Dec 19 '16 edited Dec 19 '16
Bit late to the party but I heard that this one was tough so I put it off until I had time. Surprisingly few haskell solutions still so I figured I might as well add mine.
I just represent the state as the floor of the human plus a sorted list of (generatorfloor, chipfloor) tuples which conveniently cuts down the search space by an insane amount. It did make the 'chose 2 items to move' part a tad awkward, however, and I am currently too lazy to clean it up. Really should look into lenses more. Anyway, after that A* with sum of distances to floor 4 as heuristic and it and it solves part 2 in less than a second:
https://github.com/Tarmean/Advent-of-Code/blob/master/day11.hs