Ejemplo n.º 1
0
    def test4_is_valid_jump(self):
        initial_board = get_testing_array([(3, 4), (2, 5)], [-100, 2])
        initial_state = driver.State(initial_board, constants.PLAYER2)
        self.assertFalse(
            makeMove.is_valid_jump(initial_state, (3, 4), (1, 6), False))

        initial_board = get_testing_array([(3, 4), (4, 5)], [100, -2])
        initial_state = driver.State(initial_board, constants.PLAYER1)
        self.assertFalse(
            makeMove.is_valid_jump(initial_state, (3, 4), (5, 6), False))
Ejemplo n.º 2
0
    def test2_is_valid_jump(self):
        # bottom left jump
        initial_board = get_testing_array([(3, 4), (4, 3)], [-1, -2])
        initial_state = driver.State(initial_board, constants.PLAYER2)
        self.assertFalse(
            makeMove.is_valid_jump(initial_state, (3, 4), (5, 2), True))

        # top right jump
        initial_board = get_testing_array([(3, 4), (2, 5)], [-1, -200])
        initial_state = driver.State(initial_board, constants.PLAYER2)
        self.assertFalse(
            makeMove.is_valid_jump(initial_state, (3, 4), (1, 6), True))
Ejemplo n.º 3
0
 def test1_is_valid_jump(self):
     initial_board = get_testing_array([(3, 4)], [-1])
     initial_state = driver.State(initial_board, constants.PLAYER2)
     self.assertFalse(
         makeMove.is_valid_jump(initial_state, (3, 4), (1, 1), True))
     self.assertFalse(
         makeMove.is_valid_jump(initial_state, (3, 4), (5, 2), False))
     initial_board = get_testing_array([(3, 4)], [1])
     initial_state = driver.State(initial_board, constants.PLAYER1)
     self.assertFalse(
         makeMove.is_valid_jump(initial_state, (3, 4), (4, 5), True))
     self.assertFalse(
         makeMove.is_valid_jump(initial_state, (3, 4), (2, 3), False))
Ejemplo n.º 4
0
 def test4_is_backwards_move(self):
     initial_board = get_testing_array([(3, 4)], [1])
     initial_state = driver.State(initial_board, constants.PLAYER1)
     self.assertFalse(
         makeMove.is_backwards_move(initial_state, (3, 4), (2, 3)))
     self.assertFalse(
         makeMove.is_backwards_move(initial_state, (3, 4), (2, 5)))
     self.assertFalse(
         makeMove.is_backwards_move(initial_state, (3, 4), (1, 2)))
     self.assertFalse(
         makeMove.is_backwards_move(initial_state, (3, 4), (1, 6)))
Ejemplo n.º 5
0
 def test1_is_backwards_move(self):
     initial_board = get_testing_array([(3, 4)], [-1])
     initial_state = driver.State(initial_board, constants.PLAYER2)
     self.assertTrue(
         makeMove.is_backwards_move(initial_state, (3, 4), (2, 2)))
     self.assertTrue(
         makeMove.is_backwards_move(initial_state, (3, 4), (2, 5)))
     self.assertTrue(
         makeMove.is_backwards_move(initial_state, (3, 4), (1, 1)))
     self.assertTrue(
         makeMove.is_backwards_move(initial_state, (3, 4), (1, 6)))
Ejemplo n.º 6
0
    def test3_is_valid_jump(self):
        initial_board = get_testing_array([(3, 4), (2, 5), (1, 6)],
                                          [-1, 2, -3])
        initial_state = driver.State(initial_board, constants.PLAYER2)
        self.assertFalse(
            makeMove.is_valid_jump(initial_state, (3, 4), (1, 6), True))

        initial_board = get_testing_array([(3, 4), (2, 5), (1, 6)], [-1, 2, 3])
        initial_state = driver.State(initial_board, constants.PLAYER2)
        self.assertFalse(
            makeMove.is_valid_jump(initial_state, (3, 4), (1, 6), True))

        initial_board = get_testing_array([(3, 4), (2, 5), (1, 6)], [1, -2, 3])
        initial_state = driver.State(initial_board, constants.PLAYER1)
        self.assertFalse(
            makeMove.is_valid_jump(initial_state, (3, 4), (1, 6), True))

        initial_board = get_testing_array([(3, 4), (2, 5), (1, 6)],
                                          [1, -2, -3])
        initial_state = driver.State(initial_board, constants.PLAYER1)
        self.assertFalse(
            makeMove.is_valid_jump(initial_state, (3, 4), (1, 6), True))