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

pystockfish的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类,以便在两个引擎之间对弈。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java jgrapht SimpleDirectedWeightedGraph规范化权重   java安卓使用CFB   java如何从javaclass警告浏览器?可能吗?   javagson结构难点   java使用jbossclient的最佳方式是什么。Wildfly 10应用程序中的jar?   JAVA:socket重写以使用CipherInputStream和CipherOutputStream   java Android UI测试长时间点击并拖动   java如何在Android中重置AtomicInteger唯一Id?   多线程客户端/服务器应用程序上的java客户端断开连接   GAE Memcache中的java损坏值   java如何使用变量作为资源的路径?   爪哇?(三向)操作员