{$cfg_webname}
主页 > 计算机 > C++ >

中国象棋人机对弈游戏的设计与实现

来源:wenku163.com  资料编号:WK1632136 资料等级:★★★★★ %E8%B5%84%E6%96%99%E7%BC%96%E5%8F%B7%EF%BC%9AWK1632136
资料介绍

摘  要
象棋程序的实现可以被分为人工智能和界面程序辅助两大部分。人工智能部分主要体现计算机的下棋思路,既计算机如何进行思考并以最佳走法完成下一步,先由相应的搜索算法进行搜索,并对各种可能的走法进行估值,从中选择胜利面最大的一步;而界面及程序辅助部分主要便于用户通过以前的下棋步骤,更好地调整下棋思路,着法显示使用户能够清楚地知道下棋过程,更准确地把握整个局面。
本文首先研究了中国象棋在计算机中的表示问题,接着讨论如何产生着法一系列相关内容。其次研究了博弈树的极小极大搜索技术及在此基础上发展起来的Alpha-Beta剪枝算法,使用MFC文档视图体系结构和Visual C++开发工具,实现了一个具有一定棋力的中国象棋人机对弈程序。
  
关键词:中国象棋;人工智能;博弈树;Alpha-Beta搜索
 
The Design and Implementation of Chinese Chess
Abstract
The implementation of a chess program can be decomposed into two major parts: the artificial intelligence and the user interface and program assist. The part of artificial intelligence shows the way of computer thinking, and which step is the best step would be decided by it. Firstly, the computer uses search algorithms to search, and then evaluates every impossible step, finally choses the best one, the other part is used for the player to adjust his thought to the currently phases. The display of step list makes player know the process of chess distinctly, and let player make a better choice.
This paper firstly studies how to represent a chess board in computer, then discusses how to generate legal moves. Secondly, this paper studies the mini-max searching procedure of Game Tree, and the Alpha-Beta pruning algorithm. A Chess-playing system is designed and developed, which is built on the integrated computer MFC SDI document view architecture by using Visual C++.

Key words: Chinese chess; Artificial Intelligence; Game tree; Alpha-Beta searching
 
象棋设计研究方法
对于象棋来说,核心设计主要包括人工智能算法的以及整个游戏中界面及程序辅助部分的实现,主要用 Visual C++ 进行开发,里面的MFC类库,使游戏开发更加方便,并利用人工智能相关搜索算法实现人工智能的着法生成,从而完善整个游戏的功能。
本文的目标是实现一款有着一定下棋水平且交互友好的中国象棋人机对弈程序。
该程序功能包括:
*人机对弈;
*搜索深度设定;
(电脑棋力选择)
*悔棋、还原;
*着法名称显示;
整个程序的实现可分为两大部分:
一、人工智能算法设计(计算机下棋引擎)
该部分实现了如何让计算机下中国象棋,其中涉及人机对弈的基本理论及思想,是该程序的核心部分,同时也是本项目研究的重点所在。
二、界面及程序辅助设计
光有下棋引擎尚不能满足人机交互的基本要求,因此还需要一个框架(界面)来作为引擎的载体,同时提供一些诸如悔棋,还原之类的附属功能(程序辅助)。










目  录
1 引言 1
1.1 象棋设计背景和研究意义 1
1.2 象棋设计研究方法 1
2 人工智能算法设计 2
2.1 棋局表示 3
2.2 着法生成 4
2.3 搜索算法 5
2.4 历史启发及着法排序 9
2.5 局面评估 9
2.6 程序组装 11
3 界面及程序辅助设计 12
(毕业设计)
3.1 界面基本框架 12
3.2 多线程 13
3.3 着法名称显示 14
3.4 悔棋和还原 15
4 系统实现 16
结    论 19
参考文献 20
致    谢 21
声    明 22

推荐资料