Skip to content

Commit

Permalink
Refactor (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkopec87 authored Dec 12, 2023
1 parent 106d858 commit db7b537
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions requirements-to-freeze.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
advent-of-code-data
black
isort
numpy
tqdm
4 changes: 2 additions & 2 deletions src/2023/02/2023_02.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ def main(debug: bool) -> None:
# part 1
start = {Color.RED: 12, Color.GREEN: 13, Color.BLUE: 14}
possible_games = [g for g in games if g.possible(start)]
result_part1 = reduce(operator.add, map(lambda g: g.game_id, possible_games))
result_part1 = reduce(operator.add, map(lambda g: g.game_id, possible_games), 0)

# part 2
result_part2 = reduce(operator.add, map(lambda g: g.power(), games))
result_part2 = reduce(operator.add, map(lambda g: g.power(), games), 0)

submit_or_print(result_part1, result_part2, debug)

Expand Down
2 changes: 1 addition & 1 deletion src/2023/12/2023_12.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,5 @@ def main(debug: bool) -> None:

if __name__ == "__main__":
debug_mode = True
debug_mode = False
# debug_mode = False
main(debug_mode)

0 comments on commit db7b537

Please sign in to comment.