资源简介
人机互弈的中国象棋.实现了对弈的人工智能,有人工智能的工程界面和象棋的UI界面

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using System.Reflection;
using AutoChess.DataTypes;
namespace AutoChess
{
class Chess
{
public void Move(Board board Step step)
{
step.IsLegal();
if (!step.legal)
{
step.value = -1;
return;
}
Board boardm = board.CopyObj();
step.value = 0;
if (boardm[step.end.X step.end.Y] != null && boardm[step.end.X step.end.Y].side != step.unit.side)
{
step.eatable = true;
step.eated = boardm[step.end.X step.end.Y];
step.value += Convert.ToInt32(step.eated.type);
boardm[step.end.X step.end.Y] = boardm[step.start.X step.start.Y];
boardm[step.start.X step.start.Y] = null;
}
else if (boardm[step.end.X step.end.Y] != null && boardm[step.end.X step.end.Y].side == step.unit.side)
{
return;
}
else
{
boardm[step.end.X step.end.Y] = boardm[step.start.X step.start.Y];
boardm[step.start.X step.start.Y] = null;
}
for (int i = 0; i < 5; i++)
{
}
}
public static void SimpleMove(Board board SimpleStep step)
{
if (board[step.end.X step.end.Y] != null)
step.eated = board[step.end.X step.end.Y];
board[step.end.X step.end.Y] = board[step.start.X step.start.Y];
board[step.start.X step.start.Y] = null;
}
public static void unSimpleMove(Board board SimpleStep step)
{
board[step.start.X step.start.Y] = board[step.end.X step.end.Y];
if (step.eated != null)
board[step.end.X step.end.Y] = step.eated;
else
board[step.end.X step.end.Y] = null;
}
///
/// 一个局面下一方的所有走法
///
///
///
///
public static Step[] AllSteps(Board board Color side)
{
ArrayList steps = new ArrayList();
//方在哪面,true为上面,false为下面
bool direct = true judged = false;
for (int i = 1; i < 10; i++)
{
for (int j = 1; j <= 9; j++)
{
if (board[i j] != null && board[i j].type == UnitType.将 && board[i j].side == side)
{
if (i >= 1 && i <= 3 && j >= 4 && j <= 6)
direct = true;
else if (i >= 8 && i <= 10 && j >= 4 && j <= 6)
direc
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
....... 798 2010-08-13 17:52 AutoChess\AutoChess\app.config
....... 3949 2010-08-13 17:53 AutoChess\AutoChess\AutoChess.csproj
....... 826660 2010-08-07 02:58 AutoChess\AutoChess\bin\Debug\1.bmp
文件 54272 2012-01-07 11:34 AutoChess\AutoChess\bin\Debug\AutoChess.exe
....... 798 2010-08-13 17:52 AutoChess\AutoChess\bin\Debug\AutoChess.exe.config
文件 97792 2012-01-07 11:34 AutoChess\AutoChess\bin\Debug\AutoChess.pdb
....... 14328 2012-01-07 11:35 AutoChess\AutoChess\bin\Debug\AutoChess.vshost.exe
....... 798 2010-08-13 17:52 AutoChess\AutoChess\bin\Debug\AutoChess.vshost.exe.config
....... 490 2007-07-21 01:33 AutoChess\AutoChess\bin\Debug\AutoChess.vshost.exe.manifest
....... 909078 2010-08-07 00:45 AutoChess\AutoChess\bin\Debug\UnitImg\All.bmp
....... 24534 2010-08-07 00:52 AutoChess\AutoChess\bin\Debug\UnitImg\G卒.bmp
....... 67854 2010-08-07 01:02 AutoChess\AutoChess\bin\Debug\UnitImg\G卒2.bmp
....... 24894 2010-08-07 00:54 AutoChess\AutoChess\bin\Debug\UnitImg\G士.bmp
....... 67854 2010-08-07 01:02 AutoChess\AutoChess\bin\Debug\UnitImg\G士2.bmp
....... 24894 2010-08-07 00:56 AutoChess\AutoChess\bin\Debug\UnitImg\G将.bmp
....... 67854 2010-08-07 01:02 AutoChess\AutoChess\bin\Debug\UnitImg\G将2.bmp
....... 24894 2010-08-07 00:54 AutoChess\AutoChess\bin\Debug\UnitImg\G炮.bmp
....... 67854 2010-08-07 01:02 AutoChess\AutoChess\bin\Debug\UnitImg\G炮2.bmp
....... 24894 2010-08-07 00:53 AutoChess\AutoChess\bin\Debug\UnitImg\G象.bmp
....... 67854 2010-08-07 01:03 AutoChess\AutoChess\bin\Debug\UnitImg\G象2.bmp
....... 24894 2010-08-07 00:53 AutoChess\AutoChess\bin\Debug\UnitImg\G车.bmp
....... 67854 2010-08-07 01:02 AutoChess\AutoChess\bin\Debug\UnitImg\G车2.bmp
....... 24894 2010-08-07 00:53 AutoChess\AutoChess\bin\Debug\UnitImg\G马.bmp
....... 67854 2010-08-07 01:02 AutoChess\AutoChess\bin\Debug\UnitImg\G马2.bmp
....... 23022 2010-08-07 00:47 AutoChess\AutoChess\bin\Debug\UnitImg\r卒.bmp
....... 67854 2010-08-07 01:01 AutoChess\AutoChess\bin\Debug\UnitImg\r卒2.bmp
....... 24534 2010-08-07 00:50 AutoChess\AutoChess\bin\Debug\UnitImg\r士.bmp
....... 67854 2010-08-07 01:01 AutoChess\AutoChess\bin\Debug\UnitImg\r士2.bmp
....... 24534 2010-08-07 00:51 AutoChess\AutoChess\bin\Debug\UnitImg\r将.bmp
....... 67854 2010-08-07 01:01 AutoChess\AutoChess\bin\Debug\UnitImg\r将2.bmp
............此处省略77个文件信息
相关资源
- Cisco无线AP全部配置文件(AIR-1200系列
- Training Syllabus MP3标头
- cc2541 BLE DEMO
- Apolipoprotein E4 Impairs in vivo Hippocampal
- railroad铁路CAD生成
- 黑白棋(带简单AI)
- HDD repair.rar
- 利用foxmail模板批量生成邮件
- 推箱子及人工智能寻路C 源代码
- 简易绘图的制作 (一)WPF
- tsai经典两步法 很不错的
- 北航人工智能原理课大作业源代码,
- vc编写中国象棋详细源码注释并附有视
- LSI RAID配置手册(图文)
- jmail组件 v4.3
-
解决安装vs2012后vs2010 li
nk : fatal er - Anti-biofilm Activity of Resveratrol and Ursol
- In vitro screening of lactobacilli with antago
- libaio-0.3.107-10.el6.x86_64.rpm
- spaceclaim教程
- app inventor小游戏打地鼠.aia
- app inventor 应用街景地图.aia
- pzs_44217116_06.aia
- 四大RAID存储详解
- Symantec Brightmail AntiSpam产品手册
- 昆腾数据备份解决方案增强AIG对萨班
- DataNumen Excel Repair Excel文件修复工具
- HP Kayak高性能PC选择Adaptec RAID解决方案
- Adaptec 4805SAS RAID控制器
- Xyratex欲部分收购Ario的RAID代码
评论
共有 条评论