Skip to main content

Day 24: Immune System Simulator 20XX

· One min read

Another problem that had me looking at my wrong answer for a while not understanding what was happening. This time I realized that a group with negative units could attack (because it had been killed previously in the round).

For the first part of the problem, I created a Group class that defined a single group and a ImmuneCombat class that defined the combat. The solution is pretty straight-forward, but requires a lot of reading and re-reading of the description to make sure you get all the rules (my mistake came from this).

For the second part of the problem, I simply tried every boost possible until one of them made the immune system win.