本文整理匯總了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