diff --git a/src/pydle.py b/src/pydle.py index 5c282ed..10c7baf 100644 --- a/src/pydle.py +++ b/src/pydle.py @@ -32,7 +32,12 @@ 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" + \ r"| _ \ \ / / _ \| | | ____|" + "\n" + \ @@ -45,8 +50,7 @@ print("Welcome to...") print(header()) print("A totally original guessing game!") emptyWordGuess = ["_"] * 5 -wrongLetters = set() -rightLettersWrongPlace = set() +wrongLetters, rightLettersWrongPlace = set() wordToGuess = list(getWord().upper()) # print(wordToGuess) @@ -66,12 +70,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()