本文整理汇总了Python中cython.importer.Board.hindered方法的典型用法代码示例。如果您正苦于以下问题:Python Board.hindered方法的具体用法?Python Board.hindered怎么用?Python Board.hindered使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cython.importer.Board
的用法示例。
在下文中一共展示了Board.hindered方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_hindered_in_a_board_with_just_a_knight
# 需要导入模块: from cython.importer import Board [as 别名]
# 或者: from cython.importer.Board import hindered [as 别名]
def test_hindered_in_a_board_with_just_a_knight(self):
board = Board(False)
board.load_fen("8/8/8/4N3/8/8/8/8 w kQkq - 0 1")
expected_hindered_white = set([
(3, 2), (5, 2), (6, 3), (6, 5), (5, 6), (3, 6), (2, 5), (2, 3)
])
expected_hindered_black = set()
self.assertEqual(board.hindered(WHITE), expected_hindered_white)
self.assertEqual(board.hindered(BLACK), expected_hindered_black)
self.assertEqual(board.hindered(-1), expected_hindered_white)
示例2: test_hindered_in_a_new_game
# 需要导入模块: from cython.importer import Board [as 别名]
# 或者: from cython.importer.Board import hindered [as 别名]
def test_hindered_in_a_new_game(self):
board = Board(True)
expected_hindered_white = set([
(0, 2), (1, 2), (2, 2), (3, 2), (4, 2), (5, 2), (6, 2), (7, 2)
])
expected_hindered_black = set([
(0, 5), (1, 5), (2, 5), (3, 5), (4, 5), (5, 5), (6, 5), (7, 5)
])
self.assertEqual(board.hindered(WHITE), expected_hindered_white)
self.assertEqual(board.hindered(BLACK), expected_hindered_black)
self.assertEqual(board.hindered(-1), expected_hindered_white)