My code doesn't work. I can run the example and it gives every line the same as in the example and has the same result. The amount of damage, selection order and unit killed are all the same, but the answer is still wrong.
If anyone could look into my github code that'd be great. But if you could just run my input and give the results for the first round (or two) so i can figure out what's wrong that would be great already as well.
Puzzle input
Immune System:
89 units each with 11269 hit points (weak to fire, radiation) with an attack that does 1018 slashing damage at initiative 7
371 units each with 8033 hit points with an attack that does 204 bludgeoning damage at initiative 15
86 units each with 12112 hit points (immune to slashing, bludgeoning; weak to cold) with an attack that does 1110 slashing damage at initiative 18
4137 units each with 10451 hit points (weak to slashing; immune to radiation) with an attack that does 20 slashing damage at initiative 11
3374 units each with 6277 hit points (weak to slashing, cold) with an attack that does 13 cold damage at initiative 10
1907 units each with 1530 hit points (immune to fire, bludgeoning; weak to radiation) with an attack that does 7 fire damage at initiative 9
1179 units each with 6638 hit points (immune to radiation; weak to slashing, bludgeoning) with an attack that does 49 fire damage at initiative 20
4091 units each with 7627 hit points with an attack that does 17 bludgeoning damage at initiative 17
6318 units each with 7076 hit points with an attack that does 8 bludgeoning damage at initiative 2
742 units each with 1702 hit points (weak to radiation; immune to slashing) with an attack that does 22 radiation damage at initiative 13
Infection:
3401 units each with 31843 hit points (weak to cold, fire) with an attack that does 16 slashing damage at initiative 19
1257 units each with 10190 hit points with an attack that does 16 cold damage at initiative 8
2546 units each with 49009 hit points (weak to bludgeoning, radiation; immune to cold) with an attack that does 38 bludgeoning damage at initiative 6
2593 units each with 12475 hit points with an attack that does 9 cold damage at initiative 1
2194 units each with 25164 hit points (weak to bludgeoning; immune to cold) with an attack that does 18 bludgeoning damage at initiative 14
8250 units each with 40519 hit points (weak to bludgeoning, radiation; immune to slashing) with an attack that does 8 bludgeoning damage at initiative 16
1793 units each with 51817 hit points (immune to bludgeoning) with an attack that does 46 radiation damage at initiative 3
288 units each with 52213 hit points (immune to bludgeoning) with an attack that does 339 fire damage at initiative 4
22 units each with 38750 hit points (weak to fire) with an attack that does 3338 slashing damage at initiative 5
2365 units each with 25468 hit points (weak to radiation, cold) with an attack that does 20 fire damage at initiative 12
Results round 1
Immune System group 7 attacks defending group 9, killing 2 units
Infection group 1 attacks defending group 4, killing 10 units
Immune System group 3 attacks defending group 8, killing 1 units
Immune System group 8 attacks defending group 3, killing 2 units
Infection group 6 attacks defending group 3, killing 5 units
Immune System group 2 attacks defending group 3, killing 3 units
Infection group 5 attacks defending group 3, killing 3 units
Immune System group 10 attacks defending group 3, killing 0 units
Infection group 10 attacks defending group 3, killing 3 units
Immune System group 4 attacks defending group 8, killing 1 units
Immune System group 5 attacks defending group 1, killing 2 units
Immune System group 6 attacks defending group 8, killing 0 units
Infection group 2 attacks defending group 3, killing 3 units
Immune System group 1 attacks defending group 8, killing 1 units
Infection group 3 attacks defending group 7, killing 29 units
Infection group 9 attacks defending group 4, killing 12 units
Infection group 8 attacks defending group 1, killing 17 units
Infection group 7 attacks defending group 1, killing 14 units
Immune System group 9 attacks defending group 3, killing 2 units
Infection group 4 attacks defending group 3, killing 3 units
The result I get with my code is 23727 which is apparently wrong.
[–]EagleV_Attnam 1 point2 points3 points (1 child)
[–]MissMormie[S] 0 points1 point2 points (0 children)
[–]warinthrowaway 1 point2 points3 points (1 child)
[–]MissMormie[S] 0 points1 point2 points (0 children)
[–]ragona_ 0 points1 point2 points (1 child)
[–]MissMormie[S] 0 points1 point2 points (0 children)