# ChineseChess-AI **Repository Path**: liusibo61/ChineseChess-AI ## Basic Information - **Project Name**: ChineseChess-AI - **Description**: 完成于2020年12月,大三上学期小组团队课程项目。 基于alpha-beta剪枝搜索算法实现的中国象棋AI博弈程序。 - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2022-10-12 - **Last Updated**: 2023-11-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## 项目介绍 中国象棋AI下棋完成于2020年12月,是大三上学期的小组团队课程项目-大数据应用开发。 基于alpha-beta剪枝搜索算法,没有机器学习/深度学习训练模型,可以简单玩玩,应对新手象棋玩家。 1、后端基于python编写,flask作为web框架,基于alpha-beta剪枝搜索算法实现的中国象棋博弈程序。 2、csv文件是爬虫棋谱网站,整理出来全部对局中每一步棋局布局对应的下一步棋子走法。 csv文件中近80万条数据。 3、前端就是html + css + javascript,使用axios发送请求做交互,做了行棋规则的限制。 4、当时是打包了docker镜像,用docker容器做的后端部署,方便起见,我下面就是直接python命令启动后端,没用docker打包环境了。所以本地得有python环境和相关依赖才能启动后端程序。 我负责的是前端页面的编写,主要是canvas画布画中国象棋棋盘和棋子,以及棋子移动逻辑和移动规则的编写。 ### python依赖下载 ```shell # python依赖解决方案参考下方stackoverflow博客 # https://stackoverflow.com/questions/35991403/pip-install-unroll-python-setup-py-egg-info-failed-with-error-code-1 python -m pip install --upgrade pip pip install "package-name" python3 chess_api.py nohup python3 chess_api.py & ``` https://stackoverflow.com/questions/35991403/pip-install-unroll-python-setup-py-egg-info-failed-with-error-code-1 ### 开放安全组和防火墙firewall https://blog.csdn.net/weixin_38819951/article/details/124122726?spm=1001.2101.3001.6650.1&utm_medium=distribute.pc_relevant.none-task-blog-2~default~CTRLIST~Rate-1-124122726-blog-102789233.pc_relevant_3mothn_strategy_recovery&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2~default~CTRLIST~Rate-1-124122726-blog-102789233.pc_relevant_3mothn_strategy_recovery&utm_relevant_index=2 本地打开canvas_v2.html**即可开始下棋,记得将**axios.js和bj.jpg放在和canvas_v2.html同一层级目录下,否则无法调用接口发送请求!!! **切记:将chess.html中发送请求的ip地址改为你的服务器Ip地址,或者后端部署到本地,请求的ip改为localhost**!!!