收藏 分销(赏)

中国象棋对弈系统-java课程设计.doc

上传人:快乐****生活 文档编号:5309107 上传时间:2024-10-30 格式:DOC 页数:114 大小:831.50KB
下载 相关 举报
中国象棋对弈系统-java课程设计.doc_第1页
第1页 / 共114页
中国象棋对弈系统-java课程设计.doc_第2页
第2页 / 共114页
中国象棋对弈系统-java课程设计.doc_第3页
第3页 / 共114页
中国象棋对弈系统-java课程设计.doc_第4页
第4页 / 共114页
中国象棋对弈系统-java课程设计.doc_第5页
第5页 / 共114页
点击查看更多>>
资源描述

1、stressed that promoting the comprehensive revitalization should focus on economic construction as the central focus with, pay special attention to grasp the implementation of five development concepts, deepening reform and promoting the all-round opening up, ensuring and improving peoples livelihood

2、, strengthen the construction of ecological civilization, five priorities, play development mix. To with new development concept measure work, and command action, and training cadres, in implement implementation new development concept in the looking for opportunities, and build highlights, and expa

3、nd advantage; to full deepening reform, break bound the aspects created vitality of system mechanism obstacles; to active advance full aspects opening, participation in the cast Russian Economic Corridor construction; to guarantees and improved livelihood, strongly won poverty battle; to strengtheni

4、ng ecological civilization construction, for sustainable development reserved space, for future generations left sky blue, and to green, and water clear of better homes. We must in-depth implement implementation new development concept, insisted to economic construction for Center, firmly caught dev

5、elopment this first priority, absorbed make construction, heart no distractions caught development, speed up development six big industry, in-depth implementation three big engineering, active create two big environment, out of a article quality more high, and benefits better, and structure more exc

6、ellent of transformation development of road. To strengthen ecological construction. On March 22, the deep restructuring examined and adopted the opinion on perfecting compensation mechanism of ecological protection, proposed to explore the establishment of diversified ecological compensation mechan

7、ism, progressive realization of forests, grasslands, wetlands and other areas of focus and key ecological function and other important regional ecological compensation coverage, the ecological advantages of the region will be further highlighted. We need to go green eco-building, as the essential po

8、licy, in strict accordance with the State of main function region construction requirements, careful implementation and Xiaoxing an mountains forest ecological protection and economic restructuring plan for the construction of sky blue, . Acts prohibited by picking up the remaining wells in standing

9、 timber. To focus on forest resource conservation, increase the acquisition and supervision of cold storage, no buy fruit, encourage support to leading enterprises, workers cooperatives as a unit, the contract management of forest resources, the rational protection and utilization of resources. To w

10、ork actively towards policy aimed from the level of the State Forestry Administration formulated regulations to protect forest resources as soon as possible to achieve law and regulation to protect forest resources. Should focus on forest fire prevention. Fire safety is the first priority XXXX大学计算机系

11、课程设计说明书课程名称:Java程序设计与技术课程代码:题 目:年级/专业/班:学生姓名: 学 号:指导老师:开题时间: 年 月 日完成时间:2009年 月 日2009年 月 日Java课程设计任务书及成绩评定课题名称: Java程序设计与技术完成者: 1、设计的目的与要求: 根据所学的软件工程与程序设计的知识,能够针对一个小型的数据库管理系统,进行系统的需求分析,系统设计,编码,测试等,完成题目要求的功能,从而达到掌握开发一个小型数据库的目的。2、设计进度及完成情况日 期内 容2008-12-15小组讨论,对所要做的系统有一些大致的了解2008-12-18对系统进行总体设计2008-12-2

12、0给出系统设计中所要用到的模块2008-12-24系统详细设计开始,编写代码2008-12-28完成代码的编写,开始调试程序2008-12-30开始编写文档2009-1-1初步修改文档2009-1-3文档完成,设计结束3、成绩评定:设计成绩: (教师填写)指导老师: (签字)二00 年 月 通过多种方式和手段,进行文献检索、资料收集和整理,旨在了解我国住房制度和当代居住小区规划设计、建设、发展的理论与实践问题the first responsibility of the forest, 26th spring area has fully deployed to the fire, has n

13、ow entered the fire, we have to be on duty, and defend. Determined to overcome paralysis, must not Twelve-Five no fires in the past, the reduced requirements during the period. To apply strictly the party with the responsibility, must shoulder the responsibility of the Party Secretary in particular,

14、 really practice pipes, it can never shuaishouzhanggui, be sure to layer the implementation falls fire responsibility, to ensure that no major forest fires. To adhere to balanced, correctly handle the relationship between fire and project construction, industrial development, to never miss or two. S

15、econd, to speed up the development of six major industries. Promote development in our region, the key is to give full play to resource advantage to build eco-oriented big six system, to create the new engine of economic growth. Firm confidence. Practice has proved that the big six of both central a

16、nd provincial requirements, and meet the actual da hinggan mountains, through active efforts have been showing a strong momentum of development. So, in the six on development, we must be firm in faith, go all out, perseverance, one caught in the end, convinced that Castle is not relaxed, does not re

17、ach the target will never give up. Should focus on industrial projects. Project is to accelerate the industrial development of important support and backing. Industrial project construction, my area there are few in number, small size, low level problems. This year, the project as his party has firs

18、t project, we have to work hard to project construction. Especially effective during short, catching project shall not, slow, dragging not allowed. All localities should conscientiously implement the project leadership system, timetable, roadmap, and coordinate services, tracking the whole process f

19、orward, inverted durations, speeding up progress and seek practical results. Poised to break the project build Set challenges, to accelerate the pace of preliminary formalities, the enterprises have difficulties to pull one way and also help in a timely manner to help businesses market, enhance conf

20、idence, urging work as soon as possible. To strengthen the project analysis, proper risk analysis and improve project success rates. (Specific to the XX, we still want to make good use of agricultural advantages, relying on the upper reaches of the forest in the fresh air and XXX pure water and othe

21、r resources, create high-quality, high-grade green food brands, truly reflect the original character. Meanwhile, adhere to the project as the breakthrough to promote economic development around the six industrial chain to pay special attention to forming projects, dig potential projects, focus on ke

22、y projects, actively cultivating the new leading industries and new sources of economic growth). To promote investment. More accurate professional business, and based my industrial base and resources, aimed at national industrial layout免责声明:文档在线网中所有的文档资料均由文档在线网会员提供,该文档资料的版权属于提供者所有。文档在线网会对会员提供的文档资料进行

23、筛选和编辑,但是并不声明或保证其内容的合法性和正确性。 目 录摘 要I1 引言I2 设计任务与目的I3 需求分析I4 设计思路I4.1 功能说明I象棋4.2.1 相关类的包图I:首先红方走棋,然后黑方走棋,直到一方获胜。I新游戏:任何时候可以重新开始一盘新的对奕。I悔棋:当走错棋的时候,可以悔棋。I信息提示:提示当前信息状态。I4.2详细设计I4.2.1 相关类的包图I4.2.2相关类的类图15 系统实现15.1 运行效果15.2操作介绍16 结束语1参考文献1致谢1附录A:系统源程序1附录B:编码规范1摘 要随着科学技术的不断提高,计算机科学日渐成熟,其强大的功能已为人们深刻认识,它已进入人

24、类社会的各个领域并发挥着越来越重要的作用。通过本课程设计使学生加深理解、巩固课堂理论知识和实验知识,使学生初步具备综合运用所学Java语言基础知识,面向对象程序设计的基本思想、方法与技术,网络通信编程技术和数据库编程技术等开发简单应用系统的基本能力,初步掌握软件开发中系统分析、系统设计、系统实现和系统测试等阶段的基本方法与技术,培养学生的创新意识,提高实践应用能力,为培养应用型人才服务。该程序是一个图形界面的java中国象棋对弈系统,程序实现了新游戏,悔棋,保存,打开,退出5大功能,并添加一个applet的背景音乐。关键词:JAVA 象棋 对弈 游戏Abstract with science

25、and technology unceasing enhancement, the computer science is mature day after day, its formidable function had known profoundly for the people, it entered the human society each domain and is playing more and more vital role。Causes the student through this curriculum project to deepen understanding

26、, the consolidated classroom theoretical knowledge and the experiment knowledge, causes the student to have the synthesis utilization to study the Java language elementary knowledge initially, the object-oriented programmings basic philosophy, the method and the technology, network service developme

27、nt simple application systems and so on programming technology and database programming technology basic capabilities, grasp in the software development the system analysis, the system design, the system to realize initially with stage and so on system test essential methods and the technology, rais

28、es students innovative ideology, sharpens the practice application ability, serves for the raise application talented person.The program is a graphical interface of java Chinese chess game systems, procedures for the realization of a new game, Hui Qi, preservation, open from 5 features, and an apple

29、t to add background music. Key words: JAVA chess game game Java程序设计与技术课程设计中国象棋对弈系统1 引言(本课题的来源、与该项目相关的知识的意义、作用,应用前景等)中国象棋对弈系统主要要实现的是棋子的走法,中国象棋讲究车,马,象,仕,卒,炮,将;只有当将被对方棋子覆盖,则首先覆盖对方将的一方就是胜利的一方。中国象棋对弈系统实现了双人对弈这个功能,可用于多人一起游戏。而实现中国象棋对弈系统就为象棋在网络应用平台提供多人对弈。2 设计任务与目的通过本课程设计教学所要求达到的目的是:通过本程序实现中国象棋对弈并能实现一些基本功能,如

30、:棋局的保存与棋局的调用。3 需求分析本程序实现了五个功能键,即新游戏:开始一局新的对弈;悔棋:将棋子返回刚才所处位置;打开:调用以前保存的棋局;保存:将当前棋局保存;退出:退出本程序。4 设计思路 运用GUI,JAVA标准类库和监听器等知识,首先编写一个主类Chess,构造一个主窗口,在中国象棋-Java版上添加一块可显示的棋盘,再在棋盘上添加32个棋子按钮,然后再在主窗口下面添加一块面板,用此面板来用来对“新游戏,悔棋,保存”等进行操作。1.Java中国象棋对弈系统是:图形界面,线程,监听器与文件等技术的综合运用。2.图形界面的实现:考虑到中国象棋的特点本程序使用GridLayout布局来

31、实现由于使用鼠标操作本程序使用Jbutton组件。3.对弈的实现:利用鼠标的监听来实现对象棋走法的操作。4.1 功能说明象棋4.2.1 相关类的包图:首先红方走棋,然后黑方走棋,直到一方获胜。新游戏:任何时候可以重新开始一盘新的对奕。悔棋:当走错棋的时候,可以悔棋。信息提示:提示当前信息状态。4.2详细设计 4.2.1 相关类的包图包名: com.jk.brt包中的类:Chess ChessMainFrame ChessRule4.2.2相关类的类图 5 系统实现5.1 运行效果本中国象棋对弈系统操作界面如图,还包括有背景音乐(高山流水),以及按键音。本象棋对弈系统操作是参照中国象棋走法制定的

32、,当一方的“将”或“帅”被覆盖,则另一方或的胜利:5.2操作介绍本系统包括以上五个操作键:新游戏:开始一局新的对弈;悔棋:将棋子返回刚才所处位置;打开:调用以前保存的棋局;保存:将当前棋局保存;退出:退出本程序。6 结束语(本次课程设计的体会、收获,存在问题及进一步改进思路)本次课程设计加深了对课本只是的进一步学习和巩固,由于穿插在源程序代码的编写不断学系,是我对课本知识在实际当中的运用有了一定的了解。不足主要表现在有与本源代码是在12.28号之前实现的,所以我们只做了一个主类没有创建相关的驱动类。本对弈系统基本实现了中国象棋的对弈,但由于只能人人对弈而没实现人机对弈,所以稍有遗憾。参考文献1

33、 张广彬,孟红蕊,张永宝.Java课程设计案例精编M.北京:清华大学出版社,2007,1.2 黄晓东.Java课程设计案例精编M.北京:中国水利水电出版社,2004,5.3 求是科技. Java信息管理系统开发实例导航M.北京:人民邮电出版社,2005,4.4 求是科技.Java数据库系统开发实例导航M.北京:人民邮电出版社,2004,9.5张海藩,软件工程导论(第4版).北京:清华大学出版社,20036李芝兴,Java 程序设计之网络编程. 清华大学出版社,20067 张海藩,牟永敏。面向对象程序设计实用教程。北京:清华大学出版社,20018 美豪顿等。JAVA2编程指南 。电子工业出版社,

34、20029 孙卫琴。Java网络编程精解。电子工业出版社,2007致谢(对你本次课程设计帮助过、指导过的老师及其他同学的谢语)本课程设计曾有一下人热心的帮助了我们,如杨标格教我制作包图,刘林波教我们制作类图。不但使我们完成了任务,而且还学到了知识。还有感谢老师给我们提供了可靠而且详尽的资料,让我们完成里此次课程设计。附录A:系统源程序/* * To change this template, choose Tools | Templates * and open the template in the editor. */package chinesechess;/* *中国象棋Java版V3

35、.0 *作者 *源文件:Chess.java *最后修改时间:2004-12-20 *添加功能:实现了当前棋局的保存 */import java.io.*; import java.applet.Applet; import java.applet.AudioClip; import javax.swing.*;import java.awt.*;import java.awt.event.*;import javax.swing.*;import java.util.*;import java.io.*;/主类/主框架类public class ChineseChesspublic stat

36、ic void main(String args) new ChessMainFrame(中国象棋);class ChessMainFrame extends JFrame implements ActionListener,MouseListener,Runnable MusicDemo t = new MusicDemo(); /玩家 JLabel play = new JLabel32;/棋盘JLabel image;/窗格Container con;/工具栏JToolBar jmain;/重新开始JButton anew;/悔棋JButton repent;/打开JButton sho

37、wOpen;/保存JButton showSave;/退出JButton exit;/当前信息JLabel text;/保存当前操作Vector FileVar;Vector Var;/规则类对象(使于调用方法)ChessRule rule;/*单击棋子*/*chessManClick = true 闪烁棋子 并给线程响应*/*chessManClick = false 吃棋子 停止闪烁 并给线程响应*/boolean chessManClick;/*控制玩家走棋*/*chessPlayClick=1 黑棋走棋*/*chessPlayClick=2 红棋走棋 默认红棋*/*chessPlayC

38、lick=3 双方都不能走棋*/int chessPlayClick=2;/控制棋子闪烁的线程Thread tmain;/把第一次的单击棋子给线程响应static int Man,i;ChessMainFrame()ChessMainFrame(String Title)/获行客格引用con = this.getContentPane();con.setLayout(null);/实例化规则类rule = new ChessRule();FileVar = new Vector();Var = new Vector();/创建工具栏jmain = new JToolBar();text = n

39、ew JLabel( 热烈欢迎);text.setToolTipText(提示信息);anew = new JButton( 新 游 戏 );anew.setToolTipText(重新开始新的一局);exit = new JButton( 退 出 );exit.setToolTipText(退出本程序);repent = new JButton( 悔 棋 );repent.setToolTipText(返回到上次走棋的位置);showOpen = new JButton(打开);showOpen.setToolTipText(打开以前棋局);showSave = new JButton(保存

40、);showSave.setToolTipText(保存当前棋局);/把组件添加到工具栏jmain.setLayout(new GridLayout(0,6);jmain.add(anew);jmain.add(repent);jmain.add(showOpen);jmain.add(showSave);jmain.add(exit);jmain.add(text);jmain.setBounds(0,500,450,30);con.add(jmain);/添加棋子标签drawChessMan();/*注册监听者*/注册按扭监听anew.addActionListener(this);rep

41、ent.addActionListener(this);exit.addActionListener(this);showOpen.addActionListener(this);showSave.addActionListener(this);/注册棋子移动监听for (int i=0;i screenSize.height)frameSize.height = screenSize.height;if (frameSize.width screenSize.width)frameSize.width = screenSize.width;this.setLocation(screenSiz

42、e.width - frameSize.width) / 2 - 200 ,(screenSize.height - frameSize.height ) / 2 - 290);this.setIconImage(new ImageIcon(车1.gif).getImage();this.setResizable(false);this.setTitle(Title);this.setSize(450,550);this.show();/*添加棋子方法*/public void drawChessMan()/流程控制int i,k;/图标Icon in;/黑色棋子/车in = new Imag

43、eIcon(车1.GIF);for (i=0,k=10;i2;i+,k+=385)playi = new JLabel(in);playi.setBounds(k,10,40,40);playi.setName(车1);/马in = new ImageIcon(马1.GIF);for (i=4,k=60;i6;i+,k+=285)playi = new JLabel(in);playi.setBounds(k,10,40,40);playi.setName(马1);/相in = new ImageIcon(相1.GIF);for (i=8,k=105;i10;i+,k+=195)playi = new JLabe

展开阅读全文
部分上传会员的收益排行 01、路***(¥15400+),02、曲****(¥15300+),
03、wei****016(¥13200+),04、大***流(¥12600+),
05、Fis****915(¥4200+),06、h****i(¥4100+),
07、Q**(¥3400+),08、自******点(¥2400+),
09、h*****x(¥1400+),10、c****e(¥1100+),
11、be*****ha(¥800+),12、13********8(¥800+)。
相似文档                                   自信AI助手自信AI助手
搜索标签

当前位置:首页 > 学术论文 > 其他

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        获赠5币

©2010-2025 宁波自信网络信息技术有限公司  版权所有

客服电话:4008-655-100  投诉/维权电话:4009-655-100

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :gzh.png    weibo.png    LOFTER.png 

客服