资源简介
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;
using System.Drawing.Drawing2D;
using System.IO;
namespace _555
{
public partial class Form1 : Form
{
private points[] qipan;
private Point chessman;
private Color WBcolor;
private bool start = false;
private bool winlost = false;
private bool AI = false;
private bool AIfirst = true;
private int Wtime = 0;
private int Btime = 0;
public Form1()
{
InitializeComponent();
qipan = new points[15 15];
chessman = new Point();
start = false;
winlost = false;
AI = false;
AIfirst = true;
Wtime = 0;
Btime = 0;
}
private void Draw棋盘()
{
Graphics g = this.CreateGraphics();
Pen p = new Pen(Color.Black);
for (int i = 0; i < 15; i++)
{
g.DrawLine(p (20 + i * 20) (45) (20 + i * 20) (45 + 14 * 20));
g.DrawLine(p (20) (45 + i * 20) (20 + 14 * 20) (45 + i * 20));
}
}
private void save棋盘ATT()
{
for (int i = 0; i < 15; i++)
for (int j = 0; j < 15; j++)
{
qipan[i j].POINT.X = 20 + i * 20;
qipan[i j].POINT.Y = 45 + j * 20;
qipan[i j].att = points.attribute.Null;
qipan[i j].Wfive = 0;
qipan[i j].Bfive = 0;
}
}
private void Clear棋盘()
{
Graphics g = this.CreateGraphics();
SolidBrush b = new SolidBrush(this.BackColor);
g.FillRectangle(b 0 0 559 384);
save棋盘ATT();
}
private void Draw棋子(Point pp)
{
Graphics g = this.CreateGraphics();
SolidBrush b = new SolidBrush(WBcolor);
g.FillEllipse(b pp.X pp.Y 20 20);
}
private void Draw棋子(int x int y)
{
Graphics g = this.CreateGraphics();
SolidBrush b = new SolidBrush(WBcolor);
g.FillEllipse(b x y 20 20);
}
private void 单机开始toolStripButton3_Click(object sender EventArgs e)
{
AI = true;
start = true;
winlost = false;
WBcolor = Color.White;
Wtime = 0;
Btime = 0;
toolStripButton1.Enabled = false;
toolStripButton2.Enabled = true;
toolStripButton3.Enabled = false;
toolStripSplitButton1.Enabled = false;
Clear棋盘();
if (AIfirst)
AIchess();
}
priv
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2012-11-21 16:14 555\
目录 0 2012-11-22 19:37 555\555\
文件 851 2012-11-21 16:14 555\555.sln
文件 26624 2012-12-07 22:58 555\555.suo
文件 3932 2012-11-22 20:47 555\555\555.csproj
目录 0 2012-11-21 16:14 555\555\bin\
目录 0 2012-11-22 20:59 555\555\bin\Debug\
文件 67072 2012-11-29 21:01 555\555\bin\Debug\555.exe
文件 44544 2012-11-29 21:01 555\555\bin\Debug\555.pdb
文件 11600 2012-12-07 22:58 555\555\bin\Debug\555.vshost.exe
文件 490 2009-08-31 00:40 555\555\bin\Debug\555.vshost.exe.manifest
目录 0 2012-11-21 16:14 555\555\bin\Release\
文件 24652 2012-11-29 21:01 555\555\Form1.cs
文件 15611 2012-11-29 21:01 555\555\Form1.Designer.cs
文件 12093 2012-11-29 21:01 555\555\Form1.resx
目录 0 2012-11-21 16:14 555\555\obj\
目录 0 2012-11-21 16:14 555\555\obj\x86\
目录 0 2012-11-29 21:01 555\555\obj\x86\Debug\
文件 828 2012-12-07 22:58 555\555\obj\x86\Debug\555.csproj.FileListAbsolute.txt
文件 67072 2012-11-29 21:01 555\555\obj\x86\Debug\555.exe
文件 44544 2012-11-29 21:01 555\555\obj\x86\Debug\555.pdb
文件 4440 2012-11-22 10:05 555\555\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
文件 6524 2012-11-29 21:01 555\555\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 1132 2012-11-29 21:01 555\555\obj\x86\Debug\GenerateResource.read.1.tlog
文件 718 2012-11-29 21:01 555\555\obj\x86\Debug\GenerateResource.write.1.tlog
文件 7897 2012-11-22 10:19 555\555\obj\x86\Debug\ResolveAssemblyReference.cache
目录 0 2012-11-22 20:50 555\555\obj\x86\Debug\TempPE\
文件 5120 2012-11-22 20:50 555\555\obj\x86\Debug\TempPE\Properties.Resources.Designer.cs.dll
文件 3682 2012-11-29 21:01 555\555\obj\x86\Debug\_555.Form1.resources
文件 40677 2012-11-22 20:50 555\555\obj\x86\Debug\_555.Properties.Resources.resources
文件 485 2012-11-21 16:14 555\555\Program.cs
............此处省略10个文件信息
相关资源
- VS插件源码JSLint(JS辅助工具)
- C# TIP文件生成和拆解
- C#解析HL7消息的库135797
- C# OCR数字识别实例,采用TessnetOcr,对
- 考试管理系统 - C#源码
- Asp.net学生信息管理系统源码
- asp.net C#购物车源代码
- C#实时网络流量监听源码
- C#百度地图源码
- Visual C#.2010从入门到精通配套源程序
- Winform可视化打印模板设计工具含源码
- 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#开发实例
评论
共有 条评论