diff --git a/main.py b/main.py index 99603fd..4a00f3b 100644 --- a/main.py +++ b/main.py @@ -25,9 +25,11 @@ def is_game_over(): print(f"Can you make up {WORDS_TO_WIN} words from letters in word provided by me?") print(f"Your word is '{word}'") - while not is_game_over(): guess = input("Your next take: ") + if is_word_already_guessed(guess): + print("You've already guessed that word. Try a different one.") + continue if guess in full_list: guessed += 1 guesses.append(guess) @@ -38,3 +40,5 @@ def is_game_over(): else: errors += 1 print(f"Oops :( No such word, you have {ERRORS_TO_LOSE - errors} lives more") + print(f"Game over! You have run out of lives. Better luck next time!") + exit() \ No newline at end of file