From 2df84f4776b437b9c5b503c1aada57afd3694451 Mon Sep 17 00:00:00 2001 From: Alina Li Date: Wed, 3 Jul 2024 16:18:10 +0400 Subject: [PATCH] test game_over logic --- brain_games/scripts/brain_even.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/brain_games/scripts/brain_even.py b/brain_games/scripts/brain_even.py index db7f71b..afd0f37 100644 --- a/brain_games/scripts/brain_even.py +++ b/brain_games/scripts/brain_even.py @@ -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() @@ -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)