当前位置: 首页>>代码示例>>Python>>正文


Python Board.move_checker方法代码示例

本文整理汇总了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])
开发者ID:rado992,项目名称:Python-Project,代码行数:9,代码来源:tests_board.py

示例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])
开发者ID:rado992,项目名称:Python-Project,代码行数:10,代码来源:tests_board.py

示例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])
开发者ID:rado992,项目名称:Python-Project,代码行数:11,代码来源:tests_board.py

示例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())
开发者ID:rado992,项目名称:Python-Project,代码行数:7,代码来源:tests_board.py

示例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))
开发者ID:rado992,项目名称:Python-Project,代码行数:5,代码来源:tests_board.py


注:本文中的board.Board.move_checker方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。