Nonebot2 国际象棋插件
Project description
nonebot-plugin-chess
适用于 Nonebot2 的国际象棋插件。
安装
- 使用 nb-cli
nb plugin install nonebot_plugin_chess
- 使用 pip
pip install nonebot_plugin_chess
人机功能 需要使用遵循 UCI协议 的引擎
需要在 .env
文件中添加 引擎的可执行文件的路径
chess_engine_path=/path/to/your/engine
推荐的引擎:
使用
以下命令需要加命令前缀 (默认为/
),可自行设置为空
@我 + “国际象棋人机”或“国际象棋对战”开始一局游戏;
可使用“lv1~8”指定AI等级,如“国际象棋人机lv5”,默认为“lv4”;
发送 起始坐标格式,如“e2e4”下棋;
在坐标后加棋子字母表示升变,如“e7e8q”表示升变为后;
对应的字母:K:王,Q:后,B:象,N:马,R:车,P:兵
发送“结束下棋”结束当前棋局;
发送“显示棋盘”显示当前棋局;
发送“悔棋”可进行悔棋(人机模式可无限悔棋;对战模式只能撤销自己上一手下的棋);
或者使用 chess
指令:
可用选项:
-e
,--stop
,--end
: 停止下棋-v
,--show
,--view
: 显示棋盘--repent
: 悔棋--reload
: 重新加载已停止的游戏--battle
: 对战模式,默认为人机模式--black
: 执黑,即后手-l <LEVEL>
,--level <LEVEL>
: 人机等级,可选 1~8,默认为 4
示例
特别感谢
- niklasf/python-chess A chess library for Python
- official-stockfish/Stockfish UCI chess engine
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for nonebot_plugin_chess-0.2.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46a086aa68f807f3a811fb41521e1eaea1cddc6338bfda738c6622de1fe96519 |
|
MD5 | 7a6b228dbf4054f77df3eadb3b8de024 |
|
BLAKE2b-256 | 399fc36e5080f3c472f9268374675691d43408de4545df4c5080b5a96e3b2dfd |
Close
Hashes for nonebot_plugin_chess-0.2.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d13c0e77a236f37d5e26de0a77d9a167af303dad29d930bd2a21efdf3c2b0a60 |
|
MD5 | b45103de880eeedfde4b61eee8d4b752 |
|
BLAKE2b-256 | 00738c71bfa9be3921c1e247815b78ea5bacadc14f2514c7369fe2582f8049e5 |