Skip to content

Commit

Permalink
test game_over logic
Browse files Browse the repository at this point in the history
  • Loading branch information
alinali87 committed Jul 3, 2024
1 parent 8b6ee4b commit 2df84f4
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions brain_games/scripts/brain_even.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from brain_games.scripts.brain_even_old import gen_question_brain_even
from brain_games.temp import game_over


# TODO: refactor
def even_game():
name = welcome_user()
Expand Down Expand Up @@ -42,10 +43,17 @@ def play_game(gen_question):
print('Correct!')
counter += 1
else:
print(f"'{answer}' is wrong answer ;(. "
f"Correct answer was '{correct_answer}'.")
print(f"Let's try again, {name}")
game_over(name, answer, correct_answer)
# print(f"'{answer}' is wrong answer ;(. "
# f"Correct answer was '{correct_answer}'.")
# print(f"Let's try again, {name}")
if answer != correct_answer:
print(f"'{answer}' is wrong answer ;(. "
f"Correct answer was '{correct_answer}'.")
else:
# print(f"'{answer}' is wrong answer ;(. "
# f"Correct answer was '{correct_answer}'.")
raise NotImplementedError("This 'if' branch is impossible")
print(f"Let's try again, {name}!")
return False
congrat_user(name)
# congratulate(name)
Expand Down

0 comments on commit 2df84f4

Please sign in to comment.