diff --git a/puzzles/solutions/2022/d02/p2.py b/puzzles/solutions/2022/d02/p2.py index e7948f1..9539cfa 100644 --- a/puzzles/solutions/2022/d02/p2.py +++ b/puzzles/solutions/2022/d02/p2.py @@ -11,7 +11,9 @@ def choose_shape(opponent_move: str, outcome: str) -> str: :return: shape to play for the desired outcome to happen """ mapping = shapes.OUTCOME_TO_MAPPING[outcome] - return mapping[opponent_move] + for our_move in mapping: + if mapping[our_move] == opponent_move: + return our_move def generate_moves(