r/adventofcode • u/daggerdragon • Dec 24 '18
SOLUTION MEGATHREAD -🎄- 2018 Day 24 Solutions -🎄-
--- Day 24: Immune System Simulator 20XX ---
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 24
Transcript:
Our most powerful weapon during the zombie elf/reindeer apocalypse will be ___.
This thread will be unlocked when there are a significant number of people on the leaderboard with gold stars for today's puzzle.
Quick note: 1 hour in and we're only at gold 36, silver 76. As we all know, December is Advent of Sleep Deprivation; I have to be up in less than 6 hours to go to work, so one of the other mods will unlock the thread at gold cap tonight. Good luck and good night (morning?), all!
View all comments
Show parent comment
1
u/forever_compiling Dec 26 '18
I'm misinterpreting the specification then, because resolving that fight by hand I see an infection win...
Selection priority:
- Sort by decreasing effective power
- Sort by decreasing initiative
gives:
immune1 = 100 * 10 = 1000
immune2 = 99 * 9 = 891
infection1 = 2 * 2 = 4
Target priority:
- Sort by decreasing adjusted damage
- Sort by decreasing effective power
- Sort by decreasing initiative
gives:
immune1 has to choose infection 1
immune2 has nothing to choose from
infection1 would deal immune1 1800 damage
infection1 would deal immune2 3600 damage
infection1 chooses immune2
Fight priority:
- Sort by decreasing initiative
gives:
immune1 attacks infection1 doing 0 damage and killing 0 units
immune2 has no target
infection1 attacks immune2 doing 3600 damage and killing 99 units
After this round immune1 can't damage infection1, so infection wins.
What do I have wrong in the spec?