发布于 2020-01-27 17:59:30
在Python中,您可以使用python-chess库:
import chess
import chess.engine
engine = chess.engine.SimpleEngine.popen_uci("stockfish")
board = chess.Board("rnbq1bnr/pp2k2N/8/2p1p2Q/4N3/8/PPPP1PPP/R1B1KB1R b KQ - 0 1")
info = engine.analyse(board, chess.engine.Limit(depth=20))
print("Score:", info["score"])
# Score: #+9
engine.quit()有关更多详细信息,请查看engine module。
https://stackoverflow.com/questions/59730724
复制相似问题