资源简介
人机互弈的中国象棋.实现了对弈的人工智能,有人工智能的工程界面和象棋的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个文件信息
相关资源
- Learning TensorFlow: A Guide to Building Deep
- Nate Silver The Signal and the Noise why so ma
- 万维钢《未来简史》笔记
- Guanrong Chen《Introduction to Complex Networ
- AprilTag: A robust and flexible visual fiducia
- tensorflow271134
- go语言编译的发送邮件email.exe
- chairgun3汉化版
- Air202 硬件设计手册
- IAI电缸编程手册
- Aircraft and Rotorcraft System Identification
- 2016中国人工智能行业系列研究——中
- insomniaX防止Mac air 盖上盖子休眠的软件
- luaide 免费版 0.3.7
- sumo车辆仿真
- 基于jmail控件实现邮件发送源码
- email.zip
- RaidenLite.zip
- 黄广斌-极限学习机讲义
- AI智能识别面相手相运势解析3.2.0免阀
- internet of things and ai
- 基于神经网络的溶解度预测和回归分
- Spoken_Language_Processing微软黄学东
- Artificial Unintelligence_How Computers Misund
- Practical Game AI Programming
- NSGA和NSGAII算法
- Blockchain Basics A Non-Technical Introduction
- Domain Modeling Made Functional Tackle Softwar
- Mastering AWS Security Create and maintain a s
- The Rails 5 Way(4th) 无水印原版pdf
评论
共有 条评论