Beispiel #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))
Beispiel #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))
Beispiel #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))
Beispiel #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)))
Beispiel #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)))
Beispiel #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))