API 广场 / 游戏 / 中国象棋
API

中国象棋

完整规则人机象棋,马腿象眼炮翻山将帅照面,AI四档难度

免费 正常 GET 游戏
返回首页
https://xxyh.xiaoli.icu/api/p_game_xiangqi.php
GET
https://xxyh.xiaoli.icu/api/p_game_xiangqi.php?action=open&level=hard&type=move

接口说明

完整规则人机象棋,马腿象眼炮翻山将帅照面,AI四档难度。本站自研实现,零外部依赖。用 action 参数区分开一局(open)、走一步(act)、查状态(state)、删除(close)。骰子与抽卡是无状态工具,直接传参即出结果,不需要 gameId。对局状态保存在服务端 30 分钟(大型游戏 2 小时),超时自动回收。

请求参数说明

参数名类型必填默认值说明
action string 选填 open open/act/state/close
gameId string 选填 — 对局ID
level string 选填 hard easy/normal/hard/master,默认hard
type string 选填 move act时动作:move/undo/hint/resign,默认move
from string 选填 — 起点:格子索引0~89或 x,y 坐标
to string 选填 — 终点:格子索引0~89或 x,y 坐标

在线调试 (GET)

支持自定义参数,GET 拼在链接上,POST 放在请求体
请求链接预览 https://xxyh.xiaoli.icu/api/p_game_xiangqi.php
此处将显示接口返回结果…

返回示例

{
  "code": 200, "msg": "ok",
  "data": {
    "gameId": "g_abcd1234ef", "game": "guess", "gameName": "猜数字",
    "state": { "range": {"min":1,"max":100}, "tries":0, "status":"playing" },
    "finished": false, "moves": 0, "ttlSeconds": 1800
  }
}
—