资源简介
本人毕业设计的项目,用c#编写同化棋程序。都是基本的语法,易于理解,是初学者入门的很好教材,通过大量基本结构的实际应用,可以加深对c#语言的理解。

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace 我的_同化棋
{
public partial class Form1 : Form
{
static int score1 = 0;
static int score2 = 0;
int row = 7;
int col = 7;
int squ = 294 / 7;
int bushu = 0;
int[] ChessArray = new int[7 7];
int[] FirstArray = new int[7 7];
int xFirst;
int yFirst;
int xSecond;
int ySecond;
int C = 1;
bool R;
int xDown;
int yDown;
int a = 0;
int[] liu = new int[7 7];
List Historylist = new List();
List list = new List();//存放所走每一步的数组
int[][] RecoverArr = new int[60][];
Store store;
public Form1()
{
InitializeComponent();
}
//画棋盘的方法
public void DrawBoard()
{
Graphics g = CreateGraphics();
for (int rowIndex = 0; rowIndex < row; rowIndex++)//外层控制行数
{
for (int colIndex = 0; colIndex < col; colIndex++)//内层循环控制每行的列数
{
g.DrawRectangle(Pens.Black new Rectangle(50 + colIndex * squ 50 + rowIndex * squ squ squ));
g.FillRectangle(Brushes.BurlyWood new Rectangle(50 + colIndex * squ + 1 50 + rowIndex * squ + 1 squ - 1 squ - 1));
}
}
}
//坐标值为0则清空坐标值为1则画白格,坐标值为2则画黑格,坐标值为3则画淡橘黄色
public void Draw(int[] Array int x int y)
{
Graphics g = this.CreateGraphics();
if (Array[x y] == 0)
{
g.FillRectangle(Brushes.BurlyWood new Rectangle(x * squ + 51 y * squ + 51 squ - 1 squ - 1));
}
else if (Array[x y] == 1)
{
g.FillEllipse(Brushes.White new Rectangle(51 + squ * x 51 + squ * y squ - 2 squ - 2));
}
else if (Array[x y] == 2)
{
g.FillEllipse(Brushes.Black new Rectangle(x * squ + 51 y * squ + 51 squ - 2 squ - 2));
}
else if (Array[x y] == 3)
{
g.FillRectangle(Brushes.PaleGoldenrod new Rectangle(x * squ + 51 y * squ + 51 squ - 1 squ - 1));
}
else if (Array[x y] == 4)
{
g.FillRectangle(Brushes.PaleGreen new Rectangle(x * squ + 51 y * squ + 51 squ - 1 squ - 1));
}
}
//开始游戏画四枚棋子
public void huachushi()
{
DrawBoard(); C = 1;
for (int i = 0; i < 7; i++)
{
for (int j = 0; j < 7; j++)
{
ChessArray[i j] = 0;
}
}
Chess
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 27648 2017-09-02 20:35 同化棋\我的 同化棋\bin\Debug\我的 同化棋.exe
文件 60928 2017-09-02 20:35 同化棋\我的 同化棋\bin\Debug\我的 同化棋.pdb
文件 23168 2017-09-11 18:42 同化棋\我的 同化棋\bin\Debug\我的 同化棋.vshost.exe
文件 490 2012-06-06 02:06 同化棋\我的 同化棋\bin\Debug\我的 同化棋.vshost.exe.manifest
文件 37532 2017-09-02 20:35 同化棋\我的 同化棋\Form1.cs
文件 9853 2017-09-02 20:35 同化棋\我的 同化棋\Form1.Designer.cs
文件 5817 2017-09-02 20:35 同化棋\我的 同化棋\Form1.resx
文件 467 2017-08-01 10:03 同化棋\我的 同化棋\Form2.cs
文件 2039 2017-08-01 10:03 同化棋\我的 同化棋\Form2.Designer.cs
文件 5817 2017-08-01 10:03 同化棋\我的 同化棋\Form2.resx
文件 3459 2017-09-11 18:43 同化棋\我的 同化棋\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
文件 7473 2017-09-11 18:44 同化棋\我的 同化棋\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 5120 2017-09-11 18:44 同化棋\我的 同化棋\obj\x86\Debug\TempPE\Properties.Resources.Designer.cs.dll
文件 5614 2017-09-11 18:42 同化棋\我的 同化棋\obj\x86\Debug\我的 同化棋.csproj.FileListAbsolute.txt
文件 1035 2017-09-02 20:35 同化棋\我的 同化棋\obj\x86\Debug\我的 同化棋.csproj.GenerateResource.Cache
文件 9180 2017-09-02 20:35 同化棋\我的 同化棋\obj\x86\Debug\我的 同化棋.csprojResolveAssemblyReference.cache
文件 27648 2017-09-02 20:35 同化棋\我的 同化棋\obj\x86\Debug\我的 同化棋.exe
文件 60928 2017-09-02 20:35 同化棋\我的 同化棋\obj\x86\Debug\我的 同化棋.pdb
文件 180 2017-09-02 20:35 同化棋\我的 同化棋\obj\x86\Debug\我的_同化棋.Form1.resources
文件 180 2017-08-18 15:49 同化棋\我的 同化棋\obj\x86\Debug\我的_同化棋.Form2.resources
文件 180 2017-08-18 15:49 同化棋\我的 同化棋\obj\x86\Debug\我的_同化棋.Properties.Resources.resources
文件 497 2017-07-26 08:51 同化棋\我的 同化棋\Program.cs
文件 1374 2017-07-26 08:51 同化棋\我的 同化棋\Properties\AssemblyInfo.cs
文件 4320 2017-09-11 18:44 同化棋\我的 同化棋\Properties\Resources.Designer.cs
文件 5612 2017-07-26 08:51 同化棋\我的 同化棋\Properties\Resources.resx
文件 1103 2017-07-26 08:51 同化棋\我的 同化棋\Properties\Settings.Designer.cs
文件 249 2017-07-26 08:51 同化棋\我的 同化棋\Properties\Settings.settings
文件 1717 2017-09-11 18:43 同化棋\我的 同化棋\Resources\1.gif
文件 1051 2017-09-11 18:44 同化棋\我的 同化棋\Resources\2.gif
文件 1463 2017-09-11 18:44 同化棋\我的 同化棋\Resources\3.gif
............此处省略20个文件信息
相关资源
- C# IP地址输入控件
- C#在一个窗口刷新更改另一个窗口控件
- C# TIP文件生成和拆解
- C#解析HL7消息的库135797
- C# OCR数字识别实例,采用TessnetOcr,对
- 考试管理系统 - C#源码
- asp.net C#购物车源代码
- C#实时网络流量监听源码
- C#百度地图源码
- Visual C#.2010从入门到精通配套源程序
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
评论
共有 条评论