{$cfg_webname}
主页 > 计算机 > Python >

基于Python的Reversi黑白棋游戏设计与开发

来源:56doc.com  资料编号:5D20884 资料等级:★★★★★ %E8%B5%84%E6%96%99%E7%BC%96%E5%8F%B7%EF%BC%9A5D20884
资料以网页介绍的为准,下载后不会有水印.资料仅供学习参考之用. 帮助
资料介绍

基于Python的Reversi黑白棋游戏设计与开发(任务书,开题报告,外文翻译,论文12000字,参考代码)
摘 要
黑白棋是一个相当易学,而且很受欢迎的游戏。近年来,随着机器性能的提高和相关理论的完善,人工智能这一领域变得越来越重要,在实际生活中的运用也越来越广泛。为了学习简单的人工智能,我决定用Python开发一个简单易用的黑白棋游戏程序。
本系统主要完成人机对战、双人对战、复盘、编辑残局四种游戏模式,具备提示,悔棋,编辑棋盘,播放背景音乐等基本功能。在人机对战中,通过使用alpha-beta剪枝算法和合适的估价函数来实现了一个简单的黑白棋AI。在AI的测试过程中,发现AI与AI对战的结果每次都相同,即AI每次都会以同一种方式输或赢。为了解决这一问题,使用了游戏的历史记录来优化AI的搜索算法,通过历史记录,AI可以改变下棋的策略,从而达到改善AI的目的。
关键字:黑白棋;alpha-beta搜索;电脑AI;历史记录

Abstract
Reversi is a fairly easy to learn and very popular game. In recent years, with the improvement of machine performance and the improvement of related theories, the field of artificial intelligence has become more and more important and its use in real life has become more and more extensive. In order to study simple artificial intelligence, I decided to develop an easy-to-use Reversi program in Python.
This system mainly completes four game modes: man-machine competition, double-player, replay, and editorial game. It has the basic functions of prompting, repenting, editing chessboard, and playing background music. In the man-machine battle, a simple Reversi AI was implemented using an alpha-beta pruning algorithm and a suitable valuation function. During the testing of the AI, it was found that the results of the AI and AI battles were the same each time, that is, the AI lost or won each time in the same way. In order to solve this problem, the history of the game is used to optimize the AI's search algorithm. Through historical records, the AI can change the strategy of playing chess, so as to achieve the purpose of improving the AI.
Key words:Reversi;alpha-betapruning;computerai;gamelog
 

基于Python的Reversi黑白棋游戏设计与开发
基于Python的Reversi黑白棋游戏设计与开发
基于Python的Reversi黑白棋游戏设计与开发
基于Python的Reversi黑白棋游戏设计与开发


目录
摘要    I
Abstract    II
目录    1
第1章    绪论    3
1.1    系统开发的背景    3
1.2    国内外发展现状    3
1.3    论文研究的意义    3
1.4    论文的整体结构介绍    4
第2章    系统设计    5
2.1    开发技术的选择    5
2.1.1    开发语言和GUI框架的选择    5
2.1.2    加速Python的运行    5
2.2    功能设计    7
2.2.1    功能模块    8
2.2.2    算法模块    8
第3章    系统实现    9
3.1    四大模式的实现    9
3.1.1    人机对战和双人对战模式    9
3.1.2    编辑棋局模式    11
3.1.3    复盘功能    11
3.2    功能模块的实现    13
3.2.1    保存棋局功能    13
3.2.2    悔棋功能    14
3.2.3    提示功能    15
3.2.4    音乐播放功能    16
3.3    算法模块的实现    17
3.3.1    棋盘的数据结构    17
3.3.2    找到所有合法落子位置的算法    18
3.3.3    翻转棋盘的算法    19
3.3.4    判断胜负算法    19
3.3.5    估价函数的选择    20
3.3.6    Alpha-Beta剪枝算法    24
3.4    AI算法的优化    26
3.4.1    优化的原因    26
3.4.2    优化的方法    26
3.4.3    优化的结果    27
3.4.4    算法实现的细节    27
第4章    黑白棋游戏的测试    28
4.1    悔棋功能的测试    29
4.2    提示功能的测试    30
4.3    复盘模式的测试    31
4.4    编辑棋盘模式的测试    33
第5章    总结与体会    34
参考文献    35
致谢    36

推荐资料