本文整理汇总了Python中chess.Board.set_epd方法的典型用法代码示例。如果您正苦于以下问题:Python Board.set_epd方法的具体用法?Python Board.set_epd怎么用?Python Board.set_epd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类chess.Board
的用法示例。
在下文中一共展示了Board.set_epd方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run_engine
# 需要导入模块: from chess import Board [as 别名]
# 或者: from chess.Board import set_epd [as 别名]
def run_engine(self, epd, move_time):
#self.base_engine.setoption({'Clear': 'Hash'}) # We don't need to clear hash
board = Board()
board.set_epd(epd)
self.base_engine.position(board)
self.base_engine.go(movetime=move_time, async_callback=False)
while self.base_engine.bestmove is None:
pass
return self.info_handler_base.info["score"][1].cp
示例2: run_engine
# 需要导入模块: from chess import Board [as 别名]
# 或者: from chess.Board import set_epd [as 别名]
def run_engine(self, epd, max_depth=0, move_time=0):
self.modified_engine.setoption({'Clear': 'Hash'})
board = Board()
board.set_epd(epd)
self.modified_engine.position(board)
if max_depth != 0:
self.modified_engine.go(depth=max_depth, async_callback=False)
else:
self.modified_engine.go(movetime=move_time, async_callback=False)
while self.modified_engine.bestmove is None:
pass
result = self.info_handler_modified.info["score"][1].cp
return result