Skip to main content

包装开源 Stockfish 国际象棋引擎,以便轻松集成到 python 中。

项目描述

这将 Stockfish 国际象棋引擎与 python 集成。它允许使用引擎

通过调用一个易于使用的引擎类自动处理同步。

>>> from pystockfish import *
>>> deep = Engine(depth=20)
>>> deep.setposition(['e2e4'])
>>> deep.bestmove()
{'info': 'info depth 10 seldepth 13 score cp -40
nodes 33303 nps 951514 time 35 multipv 1 pv b8c6 g1f3 g8f6
b1c3 e7e5 f1b5 f8d6 e1g1 e8g8 d2d4 e5d4 f3d4 a7a6',
'ponder': 'g1f3',
'move': 'b8c6'}
>>> deep.setposition(['e2e4','e7e5'])
>>> deep.bestmove()
{'info': 'info depth 10 seldepth 2 score cp 40
nodes 4230 nps 1057500 time 4 multipv 1 pv g1f3 g8f6
b1c3 b8c6 f1b5 f8d6 e1g1 e8g8 d2d4 e5d4 f3d4 a7a6',
'ponder': 'g8f6',
'move': 'g1f3'}

该包还实现了一个 Match 类来对弈两个引擎。

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

pystockfish-1.0.1.tar.gz (3.8 kB 查看哈希

已上传 source