AoC 2022 D2: Rock Paper Scissors
| Problem statement | Source code | Tags: Brute force
← Previous Back to AoC Index Next →
Part 1
Just compute the score for each round based on the given rules.
outcomes records all possible outcomes of the game:
Part 2
I want to keep the same score function from part 1, so instead of sumMap score games, I use sumMap (\g -> score (fst g, shape g)) games, where shape computes the shape I need to play based on the desired outcome: