makes exiting better

develop
Conor Walker 3 years ago committed by GitHub
parent 3355edd58a
commit 313b64903c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -32,6 +32,9 @@ def checkRight(wordToGuess, guessSoFar):
else: else:
return False return False
def quit():
input("Thanks for playing! Press ENTER to exit :)")
sys.exit(0)
def header(): def header():
return r" ______ ______ _ _____" + "\n" + \ return r" ______ ______ _ _____" + "\n" + \
@ -66,12 +69,11 @@ while counter < 6:
wrongLetters.add(userGuess[i]) wrongLetters.add(userGuess[i])
if checkRight(wordToGuess, emptyWordGuess): if checkRight(wordToGuess, emptyWordGuess):
print("Congratulations! The word was", ''.join(wordToGuess).capitalize()) print("Congratulations! The word was", ''.join(wordToGuess).capitalize())
exit(420) quit()
print("Incorrect letters: " + ', '.join(wrongLetters)) print("Incorrect letters: " + ', '.join(wrongLetters))
print("Correct letters in the wrong place: " + ', '.join(rightLettersWrongPlace)) print("Correct letters in the wrong place: " + ', '.join(rightLettersWrongPlace))
print("Result: " + " ".join(emptyWordGuess)) print("Result: " + " ".join(emptyWordGuess))
counter += 1 counter += 1
print("Ran out of guesses! The word was: ", "".join(wordToGuess)) print("Ran out of guesses! The word was: ", "".join(wordToGuess))
exit(69) quit()

Loading…
Cancel
Save