Skip to content

Commit

Permalink
refactored main function calc_game for codeclimate complexitiy
Browse files Browse the repository at this point in the history
Signed-off-by: hikarikumo <[email protected]>
  • Loading branch information
hikarikumo committed Dec 17, 2023
1 parent bd080ad commit 30a2377
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions brain_games/calc_game.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ def user_fail_message(name):


def calc_game_logic(name):
for counter in range(1,3):
operations = list(OPERATIONS.keys())
for operation in operations:
if not play_game(operation):
user_fail_message(name)
return
operations = list(OPERATIONS.keys())
random.shuffle(operations)
for operation in operations:
if not play_game(operation):
user_fail_message(name)
return
print(f'Congratulations, {name}!')


Expand Down

0 comments on commit 30a2377

Please sign in to comment.