欢迎来到天天文库
浏览记录
ID:40147438
大小:45.44 KB
页数:90页
时间:2019-07-23
《软著申请源代码》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、弈秋围棋游戏软件V1.0源代码90前言围棋不仅能增强思维能力,提高智力,而且富含哲理,有助于修身养性。同时它起源于中国,古称“弈”,是我国传统技艺之一。本游戏软件提供了人机对弈,和棋手对弈(局域网对弈)两种模式,局域网模式可以保证多人同时进行游戏。本软件使用C#语言编写,在windows7x64系统下采用VisualStudio2010开发和调试,附源码如下。客户端程序://-------------------login.cs---------//usingSystem;usingSystem.Collect
2、ions.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Text;usingSystem.Windows.Forms;namespacego{publicpartialclassLogin:Form{publicLogin(){InitializeComponent();}//人机对弈privatevoidbutton1_Click(objectsender,EventArgse){this
3、.Hide();Playingplaying=newPlaying();playing.ShowDialog();this.Show();}//局域网对弈privatevoidbutton2_Click(objectsender,EventArgse){弈秋围棋游戏软件V1.0源代码90this.Hide();FormRoomformroom=newFormRoom();formroom.ShowDialog();this.Show();}privatevoidbutton3_Click(objectsende
4、r,EventArgse){Application.Exit();}privatevoidbutton3_MouseEnter(objectsender,EventArgse){Buttonbtn=(Button)sender;btn.ForeColor=Color.Black;btn.BackColor=Color.White;}privatevoidbutton3_MouseLeave(objectsender,EventArgse){Buttonbtn=(Button)sender;btn.ForeCol
5、or=Color.White;btn.BackColor=Color.Black;}}}}//-------------------Playing.cs---------//usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Text;usingSystem.Windows.Forms;弈秋围棋游戏软件V1.0源代码90nam
6、espacego{publicpartialclassPlaying:Form{delegatevoidSetTextCallback(stringtext);privateenumStatus{NotStarted=0,InGame=1,RemoveDead=2,FillEmpty=3,Ended=4}privateSystem.Threading.Threadpc_play;privateBoardm_board=newBoard();privateChess.ChessTypem_turn=Chess.C
7、hessType.Black;privateintm_secondsBlack=0;privateintm_secondsWhite=0;privateTimerm_timer=newTimer();privateStatusm_status=Status.NotStarted;publicChess.ChessTypeturn{get{returnm_turn;}set{m_turn=value;this.SetTurn((m_turn.ToString()=="Black")?"黑方":"白方");}}弈秋
8、围棋游戏软件V1.0源代码90publicPlaying(){InitializeComponent();floath=this.Size.Height-10;floatw=this.Size.Width-140;m_board.ReSize(0,0,w,h);m_timer.Interval=1000;m_timer.Tick+=newEventHandler(timer_Tick)
此文档下载收益归作者所有