arknet / linereracer
国际象棋游戏引擎。
dev-master
2024-10-02 18:39 UTC
Requires
- psr/container: ^2.0
This package is auto-updated.
Last update: 2024-10-02 18:39:58 UTC
README
这是一个带有PHP API的库。
功能
- 获取可能的移动
- 棋盘位置
- 游戏和棋盘API
- Minimax alpha-beta剪枝AI
- 评估器API
- 历史API
- 30次无攻击移动后平局
- 3次重试移动后平局
计算机安装
composer require arknet/linereracer
游戏构造器
$game = (new \Arknet\LineReracer\Definition\Game);
在控制台显示游戏
$game->display();
位置设置
$game->setNotation("white-0|b,b,b,b,b,b,b,b,b,b,b,b,e,e,e,e,e,e,e,e,w,w,w,w,w,w,w,w,w,w,w,w"); //white-0 is color of movement and moves without beats
获取位置
$game->getNotation();
历史记谱设置
$game->setHistoryNotation($history)
获取历史记谱
$game->getHistoryNotation();
可能的移动
$game->getMoves();
设置移动
$game->setMove((int) $index);
计算出的Minimax alpha-beta剪枝移动
$game->getEngineMoves();
许可证:MIT