From 313b64903cd91194add444e7c7607dee24f798e3 Mon Sep 17 00:00:00 2001 From: Conor Walker <39270500+conor-walker@users.noreply.github.com> Date: Wed, 26 Jan 2022 11:56:21 +0000 Subject: [PATCH] makes exiting better --- src/pydle.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pydle.py b/src/pydle.py index 5c282ed..c8191ab 100644 --- a/src/pydle.py +++ b/src/pydle.py @@ -32,6 +32,9 @@ def checkRight(wordToGuess, guessSoFar): else: return False +def quit(): + input("Thanks for playing! Press ENTER to exit :)") + sys.exit(0) def header(): return r" ______ ______ _ _____" + "\n" + \ @@ -66,12 +69,11 @@ while counter < 6: wrongLetters.add(userGuess[i]) if checkRight(wordToGuess, emptyWordGuess): print("Congratulations! The word was", ''.join(wordToGuess).capitalize()) - exit(420) + quit() print("Incorrect letters: " + ', '.join(wrongLetters)) - print("Correct letters in the wrong place: " + ', '.join(rightLettersWrongPlace)) print("Result: " + " ".join(emptyWordGuess)) counter += 1 print("Ran out of guesses! The word was: ", "".join(wordToGuess)) -exit(69) +quit()