Ejemplo n.º 1
0
    def test_check_guess_c(self):
        code = [1,4,4,3]
        guess = [4,4,3,2]

        master = Mastermind(positions=4, colors=6, code=code)
        self.assertEqual(master.check_guess(guess), (1,2))
Ejemplo n.º 2
0
    def test_check_guess_b(self):
        code = [1,1,2,2]
        guess = [2,2,5,5]

        master = Mastermind(positions=4, colors=6, code=code)
        self.assertEqual(master.check_guess(guess), (0,2))
Ejemplo n.º 3
0
    def test_check_guess_wrong_all(self):
        code = [1,1,1,1]
        guess = [2,2,2,2]

        master = Mastermind(positions=4, colors=6, code=code)
        self.assertEqual(master.check_guess(guess), (0,0))
Ejemplo n.º 4
0
    def test_check_guess_a(self):
        code = [1,2,3,4]
        guess = [4,3,2,1]

        master = Mastermind(positions=4, colors=6, code=code)
        self.assertEqual(master.check_guess(guess), (0,4))
Ejemplo n.º 5
0
    def test_check_guess_correct_all(self):
        code = [1,2,3,4]
        guess = [1,2,3,4]

        master = Mastermind(positions=4, colors=6, code=code)
        self.assertEqual(master.check_guess(guess), (4,0))