Draw the current state of the guillotine, along with the missed and correctly-guessed letters of the secret word.
(missedLetters, correctLetters, secretWord)
| 115 | |
| 116 | |
| 117 | def drawGuillotine(missedLetters, correctLetters, secretWord): |
| 118 | """Draw the current state of the guillotine, along with the missed and |
| 119 | correctly-guessed letters of the secret word.""" |
| 120 | print(GUILLOTINE_PICS[len(missedLetters)]) |
| 121 | print('The category is:', CATEGORY) |
| 122 | print() |
| 123 | |
| 124 | # Show the previously guessed letters: |
| 125 | print('Missed letters:', end=' ') |
| 126 | for letter in missedLetters: |
| 127 | print(letter, end=' ') |
| 128 | print() |
| 129 | |
| 130 | blanks = '_' * len(secretWord) |
| 131 | |
| 132 | # Replace blanks with correctly guessed letters: |
| 133 | for i in range(len(secretWord)): |
| 134 | if secretWord[i] in correctLetters: |
| 135 | blanks = blanks[:i] + secretWord[i] + blanks[i+1:] |
| 136 | |
| 137 | # Show the secret word with spaces in between each letter: |
| 138 | for letter in blanks: |
| 139 | print(letter, end=' ') |
| 140 | |
| 141 | print() |
| 142 | |
| 143 | |
| 144 | def getPlayerGuess(alreadyGuessed): |