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