1、 论文题目: 五子棋游戏软件的设计与实现 教 学 站 学生姓名: 指导教师: 专 业: 计算机科学与技术 2014 年 4 月 30 日 I 摘要 C+语言是一种面向对象的语言,尽管在当前,可视化语言发展迅速,普及很快, 但 C+语言作为一种基础的语言,它的有时依然存在,甚至有时它是不可替代的,特 别是和硬件接口技术相联系的软件。 五子棋游戏是一种简单大众的游戏,自从计算机实现以来,深受广大电脑玩家的 喜爱,现在流行的五子棋游戏软件大多缺乏美观的界面,和容易的操作方法,电脑的 AI 值也不是很高。本文通过 C+语言在计算机图形方面的编程,设计了五子棋游戏软 件,使该软件具有美观友好的截面,在人
2、机对弈时,使电脑具有较高的智商。本游戏 是以 C+语言作为开发工具,采用搜索算法设计最优落子点开发的游戏软件。本文详 细地介绍了五子棋游戏软件设计的全过程,描述了该软件的详细功能。 关键词:关键词:C+语言; 面向对象语言; 算法 II Abstract The C+ language is an Object-oriented language, although in the current visualization language rapidly, and spread quickly, but the C+ language as a basis for language, its
3、 advantages still exist, and sometimes it is irreplaceable, particularly hardware and software interfaces are linked. Gobang game is a simple and popular game, since the computer to achieve, by the love of computer players, but now most popular game soft gobang lack aesthetic interface, and easy met
4、hod of operation, the value of the computer AI is not high. The adoption of the C+ programming language in computer graphics, designed gobang game software to enable the software with a beautiful and friendly interface in both game, the computer has a higher IQ. The game is based on C+ language, usi
5、ng searching algorithm to design best gobang. The detailed presentation of the whole process of gobang game software design, describes the software functions. Key word:C+ language; Object-oriented language; algorithm III 目录目录 摘要 . I ABSTRACT II 1 引言 . 1 1.1 五子棋的介绍 . 1 1.2 系统设计思想 . 2 1.3 开发工具简介 . 3 1
6、.4 关于 MFC 简介 . 3 1.5 论文结构 . 4 2 需求分析 . 5 2.1 需求分析的编写目的 . 5 2.2 可行性研究 . 5 2.2.1 技术可行性 . 5 2.2.2 法律可行性 . 5 2.2.3 经济可行性 . 5 2.2.4 可行性结论 . 5 2.3 五子棋游戏规则 . 5 2.3.1 无禁手规则 . 5 2.3.2 禁手规则 . 6 2.3.3 禁手的解释 . 6 2.4 任务概述 . 7 2.4.1 目标 . 7 2.4.2 处理对象 . 7 2.4.3 安全性和完整性 . 7 2.5 功能模块分类 . 7 3 总体设计 . 9 3.1 系统环境要求 . 9 3.2 总体设计过程 . 9 3.3 系统的算法设计 . 9 3.3.1 博弈树 . 9 3.3.2 极大极小值算法(Minimax Algorithm) . 10 3.3.3 负极大值算法(Negamax Algorithm) 11 IV 3.3.4 Alpha-Beta 搜索 11 3.3.5 置换表(Transposition Table) . 12 3.3.