资源简介
Java版中国象棋人机对战源代码(AI算法体现淋漓尽致)
代码片段和文件信息
package org.acerge.engine;
import java.io.Serializable;
import java.util.ArrayList;
public class ActiveBoard implements Serializable{
//Rank[x]File[x]Bottom[x] 比 x % 10x / 10x * 10运算快
public static final int[] RANK = {// File[19]=1Rank[19]=9;
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
};
public static final int FILE[] = {// File[12]=1Rank[12]=2;
0 0 0 0 0 0 0 0 0 0
1 1 1 1 1 1 1 1 1 1
2 2 2 2 2 2 2 2 2 2
3 3 3 3 3 3 3 3 3 3
4 4 4 4 4 4 4 4 4 4
5 5 5 5 5 5 5 5 5 5
6 6 6 6 6 6 6 6 6 6
7 7 7 7 7 7 7 7 7 7
8 8 8 8 8 8 8 8 8 8
};
public static final int[] BOTTOM = {
0 10 20 30 40 50 60 70 80
};
public static final int[] HORSE_LEG_TABLE = {//int
-10 0-10 0 0 0 0 0 0 -1 0
0 0 1 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 -1 0 0 0
1 0 0 0 0 0 0 10 0 10
//Move.Dst - Move.Src={-21-19-12-88121921}
//HorseLeg[Dst-Src+21]={-10-10-11-111010}:蹩马腿的增量
//Legal Move: return Squares[Move.Src + HorseLegTab[Move.Dst - Move.Src + 21]]==0
};
public static final int[] PIECE_TYPES = {
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
0 1 1 2 2 3 3 4 4 5 5 6 6 6 6 6
7 8 8 9 9 10 10 11 11 12 12 13 13 13 13 13
};
public final static int MAX_MOVE_NUM = 256;
public final static int LOOP_HASH_MASK = 0x3ff;
public final static int MAX_CONSECUTIVE_MOVES = 200;
private int player; // 0 = Red(White) and 1 = Black
private int[] evalue;//int[2]Total Value of Red(0)/Black(1) Pieces
private int[] squares;//int[90]Piece Indexes of each square Squares[i] = 0:Unoccupied 16-31:Red 32-47 = Black
private int[] pieces;//int[48]Square Indexes of each piece -1 = Captured//被吃了
// Square[x]=y(y: index of PieceTypes in Square[x])
// Pieces[y]=x(y is the pieceType x represent pieceType Y in Square 5)
// x:index of location in board(0~89)
private int[] bitFiles;//[9]方便按行位纵线查询BitFiles[1]表示第1列(b纵线)上的棋子
private int[] bitRanks;//[10]方便按列位横线查询
private BitBoard[] pieceBits;//[14]分兵种及红黑的棋子位棋盘
private BitBoard allPieces;//整个棋盘
// Zobrist Key and Lock
private long zobristKey zobristLock;
// History MoveNodes用来作为循环重复检测
private int moveNum;
MoveNode[] moveList;//[ChessStruct.MaxMoveNum];
char[] loopHash;//[LoopHashMask + 1];
public ActiveBoard() {
int i;
player = 0;
evalue = new int[2];
evalue[0] = evalue[1] = 0;
squares = new int[90];
for (i = 0; i < 90; i ++) {
squares[i] = 0;
}
pieces = new int[48];
for (i = 16; i < 48; i ++) {
pieces[i] =
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
----------- --------- ---------- ----- ----
10025133 164
相关资源
- Java JAI API文档
- AIDE最新版本
- eyoumailserversetup.exe
- baiduMapTest android 百度地图轨迹
- AI伴侣_version2.23
- 基于JMS的WEB邮件客端系统(JAVAMAIL版)
- saif相关jar包
- Android游戏中国象棋源代码
- airscreen miracast TV BOX
- 中国象棋源代码(Java)
- JavaMail+Ajax+Jsp实现邮箱发送验证消息并
- SUBMAIL-JAVA-SDK-AND-DEMOS-master.zip
- Java 中国象棋 v2.1
-
ob
jectaid-1.1.4(UML) - Android项目源码安卓联网中国象棋源码
- java课程设计 中国象棋
- 通过Java代码方式发送邮件
- jai_core合集jar包
- java mail 可以指定附件和要上传的文件
- JAVAIO流学习总结转
- android 游戏源码 棋类游戏 象棋
- 基于android的手机象棋游戏设计毕业论
- Android GAIA Control
- Smali2Java1.0.0.558
- android 邮箱源码52898
- javax.media.jai.PlanarImage相关jar
- android中国象棋源码105221
- AIDL详细demo
- 中国象棋人机对弈android游戏源代码
- 国际象棋源代码-JAVA
评论
共有 条评论