电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

基于博弈树的AI五子棋实现

基于博弈树的AI五子棋实现_第1页
1/35
基于博弈树的AI五子棋实现_第2页
2/35
基于博弈树的AI五子棋实现_第3页
3/35
基于博弈树的 AI 五子棋实现 Realization of AI gobang Based on Game Tree摘 要 五子棋是一种简单且娱乐性较强的大众化游戏。但是在比赛和大众之间的流传度不是很高,为了解决玩家之间对战水平不够高,五子棋的挑战性还有待提高这个问题,我设计了这个基于博弈树算法的 AI 五子棋游戏,让玩家能够体验跟 AI 对战的压迫感和挑战性。本设计的实现采取调用 python 语言的 graphics 图形模块库来规划出该游戏程序的大小,定义为 16×16 的棋盘,然后用 range 函数划定棋盘。每次下棋所点击的位置通过判定落子位置是否在 x≥0 且≤15 范围内以判断是否落子有效。应用 tkinter 类库实现弹窗设计,以完成计分板与计分系统。通过仿真双方轮流在棋盘上下棋,电脑方结合三层博弈树算法的极大极小值剪枝,通过博弈树搜索出最优的落子位置,实现电脑方成为一个智能化的对手。与普通五子棋游戏的人机模式相比,智能化人机明显更具可玩性和挑战性,更加受到大众的青睐。关键词:五子棋;人工智能;博弈论;极大极小搜索Abstract Gobang is a simple and entertaining popular game.However, the popularity between the game and the public is not very high. In order to solve the problem that the level of fighting between players is not high enough and the challenge of gobang still needs to be improved, I designed the game of AI gobang based on the game tree algorithm, so that players can experience the pressure and challenge of fighting against AI.The design of the implementation of the use of calling python language graphics module library to plan the size of the game program, defined as a 16×16 board, and then use the range function to delimit the board.The position clicked in each chess game determines whether the position of the drop is within the range of x≥0 and ≤15 to determine whether the drop is valid.Tkinter class library is applied to realize the popover design to complete the scoreboard and scoring system.By simulating the two sides playing chess in turn on ...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

基于博弈树的AI五子棋实现

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部