摘 要
象棋程序的实现可以被分为人和人对战部分。人工智能部分主要体现计算机的下棋思路,既计算机如何进行思考并以最佳走法完成下一步,先由相应的搜索算法进行搜索,并对各种可能的走法进行估值,从中选择胜利面最大的一步;而界面及程序辅助部分主要便于用户通过以前的下棋步骤,更好地调整下棋思路,着法显示使用户能够清楚地知道下棋过程,更准确地把握整个局面。
本论文通过实际应用软件的开发深入分析和研究JAVA开发技术。实现中国象棋的人机会话。本文实现了中国象棋在计算机中表示问题,基于JAVA平台应用,人和人对战模拟现实中的人人对战;讨论走棋规则和着法的实现等一系列问题,最终电脑能够通过产生着法,搜索,估计来产生一步最优的走棋,实现人机会话的目的。
关键字:中国象棋,JAVA,游戏,人和人对战
ABSTRACT
The implementation of a chess program can be divided into people and battle. The part of artificial intelligence shows the way of computer chess, both the computer how to think and to the best way to complete the next step, the corresponding search algorithm to search, and the valuation of the possible moves, the biggest victory step to choose from; and the auxiliary part of the interface and the program is convenient for the user to the previous chess procedures, better adjustment of the chess ideas, we show the user can clearly know the process of chess, more accurately grasp the situation.
In this paper, through the practical application of software development and deeply analysis and Research on the development technology of JAVA. Realize the Chinese chess man-machine conversation. In this paper, the China chess said problems in the computer, the JAVA platform based applications, and the battle simulation in reality all war; to discuss a series of problems go chess rules and law etc. Finally, computer can search by generating method, step, estimated to generate optimal chess, man-machine conversation the purpose of.
Keywords: Chinese chess, JAVA, games, and the people of war
目 录
摘 要 I
ABSTRACT II
1 绪论 1
1.1 研究背景 1
1.2 研究意义 1
2开发环境介绍 3
2.1 Eclipse介绍 3
2.2 JAVA 简介 4
2.2 Jar命令 4
3 功能需求分析 6
3.1 可行性研究 6
3.2 界面的需求分析 6
3.3 走棋需求分析 7
3.3类框架的设计 7
4系统的设计 9
4.1 界面的设计 9
4.2象棋的规则及走法的实现 9
4.2.1行棋规则 9
4.2.2棋盘的表示 21
5 系统实现 23
5.1菜单界面 23
5.3 帮助界面 23
5.4游戏界面 24
6 运行测试 27
7 结束语 28
致 谢 29
参考文献 30
1 绪论
1.1 研究背景
中国象棋发展至今已有两千三、四百年的历史,早在战国时期就有正式的记载,堪称中国的国粹。中国象棋具有悠久的历史,深的人们的喜爱,象棋的爱好者也更是数不胜数,远在战国中国象棋便在贵族阶层广为流传,早期的象棋是象征着当时战斗场面的游戏,后来这种观念慢慢被改变,经过千年的流传不断的完善和改进,成为人们休闲娱乐、锻炼脑力思维不可获取的好方式。
中国象棋体现的是一种策略,方寸之间包含天地玄机,人生哲理,使人越是细玩越觉其味悠然深远。由于简单的行棋规则,趣味性强,便捷的载体,使得象棋成为雅俗共赏的竞技项目。因此,也成为流行极为广泛的棋艺活动。是我国正式开展的78个体育项目之一,为促进该项目在世界范围内的普及和推广,在中国古代,象棋被列为士大夫们的修身之艺,现在则被视为怡神益智的一种有益的活动。有着数以亿计的爱好者。它不仅能丰富文化生活,陶冶情操,在棋战中,人们可以从攻与防、虚与实、整体与局部等复杂关系的变化中悟出某种哲理;更有助于开发智力,启迪思维,锻炼辨证分析能力和培养顽强的意志。