- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
PAGE 29
摘 要
五子棋是一种简单且娱乐性较强的大众化游戏。但是在比赛和大众之间的流传度不是很高,为了解决玩家之间对战水平不够高,五子棋的挑战性还有待提高这个问题,我设计了这个基于博弈树算法的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 the board, the computer side combined with the minimax pruning of the three-layer game tree algorithm, through the game tree to search for the optimal position, the computer into an intelligent opponent.Compared with the man-machine mode of general gobang game, intelligent man-machine is obviously more playable and challenging, and is more favored by the public.
Key words: gobang; artificial? intelligence; game theory; Minimax search
目录
TOC \o 1-3 \h \z \u 第一章 绪论 1
1.1 研究背景 1
1.2 研究意义 1
1.3 博弈思想 2
1.3.1 博弈的定义 2
1.3.2 博弈的要素和特点 2
1.4 基本目标和主要内容 3
第二章 程序开发环境的介绍 5
2.1 程序开发语言 5
2.2 运行环境 5
原创力文档


文档评论(0)