Module day24

Source
Expand description

Β§Immune System Simulator 20XX

Similar to Day 15 we implement the rules precisely, paying attention to edge cases.

In particular during part two, it’s possible for a fight to end in a draw, if both armies become too weak to destroy any further units. As each fight is independent, we find the minimum boost value with a multithreaded parallel search.

StructsΒ§

Group πŸ”’
Input
Shared πŸ”’
Shared between threads for part two.

EnumsΒ§

Kind πŸ”’

FunctionsΒ§

fight πŸ”’
parse
parse_group πŸ”’
Parsing the input relatively cleanly is a challenge by itself.
parse_list πŸ”’
There can be any amount of weaknesses or immunities.
part1
part2
worker πŸ”’