예제 #1
0
 def test_safely_put_one_more_queen_on_a_board_with_knight_pattern_starting_from_h8(self):
     board = get_board(["h8", "g6", "f4", "e2"])
     column_d = ["d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8"]
     board, queen_position = safely_put_one_more_queen(board, column_d)
     self.assertEquals(5, count_queen(board))
     self.assertTrue(validate_board(board))
     self.assertTrue(is_queen(board, "d7"))
예제 #2
0
 def test_safely_put_one_more_queen_on_a_board_with_knight_pattern_starting_from_a1(self):
     board = get_board(["a1", "b3", "c5", "d7"])
     column_e = ["e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8"]
     board, queen_position = safely_put_one_more_queen(board, column_e)
     self.assertEquals(5, count_queen(board))
     self.assertTrue(validate_board(board))
     self.assertTrue(is_queen(board, "e2"))
예제 #3
0
 def test_safely_put_one_more_queen_on_empty_board(self):
     board = get_board([])
     board, queen_position = safely_put_one_more_queen(board)
     self.assertEquals(1, count_queen(board))
     self.assertTrue(validate_board(board))
예제 #4
0
 def test_solve_puzzle_starting_at_middle_of_the_board(self):
     starting_point = "d5"
     board = solve_puzzle(starting_point)
     self.assertTrue(is_queen(board, "d5"))
     self.assertTrue(validate_board(board))
     self.assertEquals(8, count_queen(board))
예제 #5
0
 def test_solve_puzzle_starting_at_top_left_corner(self):
     starting_point = "a8"
     board = solve_puzzle(starting_point)
     self.assertTrue(is_queen(board, "a8"))
     self.assertTrue(validate_board(board))
     self.assertEquals(8, count_queen(board))
예제 #6
0
 def test_solve_puzzle_starting_at_bottom_right_corner(self):
     starting_point = "h1"
     board = solve_puzzle(starting_point)
     self.assertTrue(is_queen(board, "h1"))
     self.assertTrue(validate_board(board))
     self.assertEquals(8, count_queen(board))
예제 #7
0
 def test_count_queen_on_board_with_queen_at_a1(self):
     number_of_queens = count_queen(board_with_queen_at_a1)
     self.assertEquals(1, number_of_queens)
예제 #8
0
 def test_count_queen_on_empty_board(self):
     number_of_queens = count_queen(empty_board)
     self.assertEquals(0, number_of_queens)
예제 #9
0
 def test_safely_put_one_more_queen_on_a_board_with_queen_at_a1_and_b3(self):
     board_with_queen_at_a1_and_b3 = put_queen(board_with_queen_at_a1, "b3")
     board, queen_position = safely_put_one_more_queen(board_with_queen_at_a1_and_b3)
     self.assertEquals(3, count_queen(board))
     self.assertTrue(validate_board(board))
예제 #10
0
 def test_safely_put_one_more_queen_on_a_board_with_queen_at_a1(self):
     board, queen_position = safely_put_one_more_queen(board_with_queen_at_a1)
     self.assertEquals(2, count_queen(board))
     self.assertTrue(validate_board(board))