Merge branch 'develop'

develop
Conor Walker 3 years ago
commit 2d0d7b2173

@ -33,6 +33,11 @@ def checkRight(wordToGuess, guessSoFar):
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" + \
r"| _ \ \ / / _ \| | | ____|" + "\n" + \ r"| _ \ \ / / _ \| | | ____|" + "\n" + \
@ -45,8 +50,7 @@ print("Welcome to...")
print(header()) print(header())
print("A totally original guessing game!") print("A totally original guessing game!")
emptyWordGuess = ["_"] * 5 emptyWordGuess = ["_"] * 5
wrongLetters = set() wrongLetters, rightLettersWrongPlace = set()
rightLettersWrongPlace = set()
wordToGuess = list(getWord().upper()) wordToGuess = list(getWord().upper())
# print(wordToGuess) # print(wordToGuess)
@ -66,12 +70,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