本文整理汇总了Python中board.Board.move_checker方法的典型用法代码示例。如果您正苦于以下问题:Python Board.move_checker方法的具体用法?Python Board.move_checker怎么用?Python Board.move_checker使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类board.Board
的用法示例。
在下文中一共展示了Board.move_checker方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_knock_tile
# 需要导入模块: from board import Board [as 别名]
# 或者: from board.Board import move_checker [as 别名]
def test_knock_tile(self):
board = Board()
board.move_checker('W', 1, 6)
board.move_checker('B', 17, 1)
#print(board.get_board())
self.assertEqual(1, board.get_board()['W'][0])
self.assertEqual(1, board.get_board()['B'][18])
示例2: test_move_tile
# 需要导入模块: from board import Board [as 别名]
# 或者: from board.Board import move_checker [as 别名]
def test_move_tile(self):
board = Board()
board.move_checker('W', 1, 3)
self.assertEqual(1, board.get_board()['W'][4])
self.assertEqual(1, board.get_board()['W'][1])
board.move_checker('W', 1, 3)
self.assertEqual(2, board.get_board()['W'][4])
self.assertEqual(0, board.get_board()['W'][1])
示例3: test_takeout
# 需要导入模块: from board import Board [as 别名]
# 或者: from board.Board import move_checker [as 别名]
def test_takeout(self):
board = Board(TAKEOUT_GAME)
#print(board.get_board())
board.move_checker('W', 19, 6)
board.move_checker('W', 24, 1)
self.assertEqual(False, board.move_checker('W', 24, 5))
self.assertEqual(2, board.get_board()['W'][25])
self.assertEqual(2, board.get_board()['W'][24])
self.assertEqual(4, board.get_board()['W'][19])
示例4: test_deep_copy
# 需要导入模块: from board import Board [as 别名]
# 或者: from board.Board import move_checker [as 别名]
def test_deep_copy(self):
board1 = Board()
board2 = copy.deepcopy(board1)
board1.move_checker('W', 1, 1)
self.assertNotEqual(board1.get_board(), board2.get_board())
示例5: test_forbidden_move
# 需要导入模块: from board import Board [as 别名]
# 或者: from board.Board import move_checker [as 别名]
def test_forbidden_move(self):
board = Board()
self.assertEqual(False, board.move_checker('W', 1, 5))