`
FansUnion
  • 浏览: 153161 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

中国象棋程序的设计与实现(三)--2012本科毕业论文等重要文档资料

 
阅读更多

最近陆续发表了中国象棋程序的截图和源码,受到了不少CSDN网友的好评。中国象棋程序是我大学时期的最佳原创作品,同时这也是我的毕业设计选题。当然,我开发中国象棋主要还是为了锻炼。今天,正式向广大网友分享我的毕业论文相关资料,如论文、答辩PPT、外文翻译等。

中国象棋系列文章,还有很多篇。目测,不能在国庆节前全部发表了。本来想提前透露2篇的,还是算了。

感谢大家的厚爱和支持。如果觉得好,记得分享、顶、评论啊。(*^__^*)

大学修炼:2008-2012年就读于武汉科技大学-计算机学院-软件工程专业,在黄家湖校区非常宅地修炼了4年。

毕业设计:题目是“基于Java的中国象棋程序的设计与实现”

答辩时间:2012年6月

论文下载地址

CSDN(免积分):http://download.csdn.net/detail/fansunion/6312157

楚汉棋兵交流群-群共享:号 232733905

论文下载包括的内容

a.中国象棋—毕业论文.doc

b.外文翻译-虚拟机的结构.doc

c.答辩问题5个.doc

d.毕业设计工作记录.doc

e.论文任务分解.txt

f.摘要.txt

g.致谢.doc

h.单独章节

毕设论文-第1章-绪论.doc

毕设论文-第2章-中国象棋概述.doc

毕设论文-第3章-相关工具及技术.doc

毕设论文-第4章-系统的分析和设计.doc

毕设论文-第5章-主要算法和实现.doc

毕设论文-第6章-系统演示.doc

毕设论文-第7章-结论.doc

i.ReadMe.txt

j.论文答辩.ppt

摘要

摘 要

随着互联网的发展,各种各样的互联网应用已经融入到网民的生活中。游戏已成为网民生活不可或缺的一部分,其中中国象棋程序是其中的一款经典应用。中国象棋是中华民族的传统文化,不仅在国内深受群众喜爱,而且流传国外。将经典的棋类游戏引入到网民的生活中,是非常有意义的。

中国象棋程序主要有五大功能,打谱、人机对弈、联网对战、装载演示和扩展应用。五个模块相对独立,体现了模块化思想。五个模块既有共同的地方,也有不同的地方。

打谱就是自由摆放棋子,轮流走红黑双方的棋子,分析棋谱,提高下棋水平。打谱分为全局打谱和残局打谱。人机对弈就是人和机器对战,机器的水平应该越高越好。联网对战是玩家通过互联网实现联机对战,可以包含红方、黑方和观察者等多种角色。打谱、人机对弈、玩家对战都会产生棋谱,读取这些棋谱,然后演示它们。

扩展应用是利用程序中已有的组件,实现新的功能,比如八皇后和迷宫求解。将八皇后和迷宫求解两个经典问题成功应用到中国象棋程序中,充分体现了中国象棋程序的可扩展性。

本系统使用Java语言实现,图形用户界面使用Swing实现,网络通信使用Socket实现,人机对弈主要使用的Alpha-Beta算法,棋谱主要保存为2种格式,文本格式和二进制格式。

关键词:中国象棋;人机对弈;游戏;联网对战;图形用户界面

Abstract

With the development of the Internet, a variety of Internet applications have been incorporated into the lives of Internet users. The games have become an integral part of Internet users living, including Chinese. Chinese chess program is a classic application. Chinese chess is the traditional Chinese culture, and are very popular not only in the country, but also spread abroad. Bringing the classic board games into the lives of Internet users is very meaningful.

Chinese chess program has five main functions, playing manual, the man-machine play, network play, loading presentations and extended applications. The five modules are relatively independent, reflecting the modular thinking. The five modules have a common place and there are different places.

Playing manual is the freedom to put a piece, in turn move both sides of the chess piece, analyzing chess to improve chess level. Playing manual is divided into the global paly manual and partial play manual. Man-machine play is the man and machine battle, the level of the machine thinking should be as high as possible. The network play is the players to play games through the Internet; it can contain the multiple roles of the red side, the dark side and the observer. Playing manual, man-machine play, and network-play will create chess manual, read these chess manuals, and then demonstrate them.

Extension applications are already in use program components, to finish new features, such as the eight queens and maze solving. Eight queens and maze solving bring the classic problem into the application of Chinese chess program; this fully reflects the scalability of the Chinese chess program.

This system is developed using the Java language, the graphical user interface is finished using Java swing, and the network communication is implemented using the Socket. Man-machine play mainly uses the Alpha-Beta algorithm. The chess manual have two kinds of format, text format and binary format.


Key words: Chinese Chess; Artificial Intelligence; Game;

Network-Play; Graphical User Interface

论文目录

目 录

1 绪论... 1

1.1 选题研究的背景... 1

1.2 本文的研究目的和主要工作... 1

1.3 论文结构... 2

2 中国象棋概述... 3

2.1 简介... 3

2.2 历史... 3

2.3 走棋... 3

2.4 棋子和棋盘... 5

2.5 记谱规则... 5

3 相关工具及技术... 6

3.1 Java语言简介... 6

3.2 Java平台... 6

3.2.1 Java虚拟机... 7

3.2.2 Java开发工具包... 8

3.3 开发平台和工具... 8

4 系统的分析和设计... 9

4.1 功能列表... 9

4.1.1 功能概述... 9

4.1.2 通用功能... 9

4.1.3 打谱... 11

4.1.4 联网对战... 12

4.1.5 人机对弈... 14

4.1.6 装载演示... 14

4.1.7 扩展应用... 15

4.2 系统架构... 15

4.3 设计思路... 16

4.4 界面设计... 17

4.4.1 AWT/SWING类库... 17

4.4.2 界面布局... 17

5 主要算法和实现... 18

5.1 核心算法... 18

5.1.1 绘制棋盘... 18

5.1.2 绘制棋子... 19

5.1.3 记录棋谱... 19

5.1.4 游戏规则... 19

5.1.5 走棋算法... 22

5.1.6 棋子闪烁... 23

5.1.7 保存和读取棋谱... 23

5.2 网络通信... 24

5.2.1 通信协议... 24

5.2.2 消息处理过程... 26

5.2.3 Socket实现... 28

5.3 人工智能... 28

5.3.1 局面表示... 28

5.3.2 走法表示... 29

5.3.3 生成走法... 29

5.3.4 局面评估... 29

5.3.5 搜索算法... 29

5.3.6 人机博弈流程... 30

6 系统演示... 30

6.1 主界面... 30

6.2 打谱... 31

6.2.1 全局打谱... 31

6.2.2 残局打谱... 31

6.3 联网对战... 32

6.4 扩展应用... 32

6.4.1 N皇后... 32

6.4.2 迷宫求解... 33

结论... 34

参考文献... 35

致 谢... 36

答辩问题5个

1.棋子是怎么表示的?

棋子是用对象来表示的,主要包括 棋子ID、棋子类别、棋子所在方的角色、棋子的坐标等属性。

2.联网对战是如何通信的?

服务器和客户端的通信及数据包的发送和接收,是通过Java里的Socket和ServerSocket类来实现的。具体的通信,是根据自己制定的应用层协议来表达具体的某种通信消息。

3.游戏规则是怎么实现的?

游戏规则放在ChessRule类中,是根据棋子、起点坐标和终点坐标动态判断的。

4.输入棋谱是什么意思?

输入“馬八进七”等表示棋谱的文字,程序自动解析,然后移动合适的棋子到合适的位置。

5.棋盘是如何实现的?

棋盘是使用图形绘制API画出来的。先画10条横线,9条纵线,再绘制九宫格和炮兵标记,最后绘制“楚河汉界”4个汉字。

回答几个最近网友遇到的问题&我的吐槽

a.下载的程序,有同学说jar包啥的不完整。

这真是让人蛋碎啊。

有不少同学都下载运行成功了,还给我截图了。

只可惜,觉得有问题的吐槽我的代码有问题,觉得好的同学都不给我的资源给予评论。

b.有部分类导入,如sun.audio.AudioPlayer编译器给予错误警告,需要设置编译器的级别

c.加入楚汉棋兵交流群的人很少,目前只有8个。

有的同学遇到问题,总是直接QQ我。

我已经说过了,有问题在群里交流,要不然我每次都重复回答问题。

我不是做慈善的,没有那么多时间无偿回答每个人的问题,有问题在群里问了,我只需要回答一遍就好了。

如遇到问题,请加入群,我有空的时候给予回答。

原文参见:我的独立博客 http://FansUnion.cn/articles/2483

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics