Exemple #1
0
 def test_retry_or_exit_true(self):
     test = Retry.retry_or_exit()
     self.assertFalse(test)
Exemple #2
0
 def test_retry_or_exit_false(self):
     with self.assertRaises(SystemExit) as test:
         Retry.retry_or_exit()
     self.assertEqual(test.exception.code, 0)
Exemple #3
0
            for letter in word:
                if letter == guess:
                    letter_index.append(count)
                count += 1

            # switches the place holder '-' to the corect letter
            for i in letter_index:
                word_check[i] = guess

            # creates a string of every letter that is correct
            # and places holders for unknown letters
            check = UpdateDis.update_ans_dis()
            if check == word:
                print("YOU WIN!!!")
                gr.refresh_screen()
                Retry.retry_or_exit()
                break

            tried.append(guess)

        elif guess not in word:
            draw = man[chances]
            draw()
            if chances == 5:
                print(f"the word was {word}")
                gr.refresh_screen()
                Retry.retry_or_exit()
                break

            tried.append(guess)
            chances += 1