def runGuess(self, numGuesses): """ Gets and evaluates one guess and increases the score """ guess = self.screen.guess(numGuesses) # Get initial guess if WordValidator.correctWord(guess): self.score = self.score + WordGuessGame.SCORES[numGuesses] self.screen.winRound(guess, self.score) return True response = WordValidator.validate(guess) # Validate the guess self.screen.respond(response) # Has Screen display the response to the guess
def testCorrectWord_incorrect(self): """ Recognize incorrect matches between target and guess """ WordValidator.correctWord("abc"), "Should be incorrect word"
def testCorrectWord_correct(self): """ Recognize correct matches between target and guess """ assert WordValidator.correctWord("sky") , "Should be the correct word"