Exemple #1
0
 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
     
     
Exemple #2
0
 def testCorrectWord_incorrect(self):
     """ Recognize incorrect matches between target and guess  """
     WordValidator.correctWord("abc"),  "Should be incorrect word"
Exemple #3
0
 def testCorrectWord_correct(self):
     """ Recognize correct matches between target and guess """
     assert WordValidator.correctWord("sky") , "Should be the correct word"