/* These will go into an array */
-#define NOPIECE 0x00
-#define PAWN 0x01
-#define KNIGHT 0x02
-#define BISHOP 0x03
-#define ROOK 0x04
-#define QUEEN 0x05
-#define KING 0x06
-
-#define MAX_BOARD_STRING_LEGTH 1280 /* Abitrarily 80 * 16 */
+#define NOPIECE 0
+#define PAWN 1
+#define KNIGHT 2
+#define BISHOP 3
+#define ROOK 4
+#define CARDINAL 5
+#define MARSHALL 6
+#define MAN 7
+#define QUEEN 8
+#define ELEPHANT 9
+#define ALFIL 10
+#define FERZ 11
+#define WAZIR 12
+#define HORSE 13
+#define HONORABLEHORSE 14
+#define DRAGONKING 15
+#define DRAGONHORSE 16
+#define LANCE 17
+#define CANNON 18
+#define SILVER 19
+#define GOLD 20
+#define NIGHTRIDER 21
+#define MANDARIN 22
+#define FERZ2 23
+#define ALFIL2 24
+#define PRIESTESS 25
+#define MINISTER 26
+#define MAN2 27
+#define MODERNELEPHANT 28
+#define WOODY 29
+#define SQUIRREL 30
+#define MASTODON 31
+#define CENTAUR 32
+#define PRINCESS 33
+#define EMPRESS 34
+#define AMAZON 35
+#define KING 36
+
+#define MAX_BOARD_STRING_LENGTH 1280 /* Abitrarily 80 * 16 */
#define MAX_STYLES 13
#define W_PAWN (PAWN | WHITE)
#define W_KNIGHT (KNIGHT | WHITE)
#define W_BISHOP (BISHOP | WHITE)
#define W_ROOK (ROOK | WHITE)
+#define W_CARDINAL (CARDINAL | WHITE)
+#define W_MARSHALL (MARSHALL | WHITE)
+#define W_MAN (MAN | WHITE)
#define W_QUEEN (QUEEN | WHITE)
+#define W_ELEPHANT (ELEPHANT | WHITE)
+#define W_ALFIL (ALFIL | WHITE)
+#define W_FERZ (FERZ | WHITE)
+#define W_WAZIR (WAZIR | WHITE)
+#define W_ALFIL2 (ALFIL2 | WHITE)
+#define W_FERZ2 (FERZ2 | WHITE)
+#define W_AMAZON (AMAZON | WHITE)
+#define W_CENTAUR (CENTAUR | WHITE)
+#define W_HORSE (HORSE | WHITE)
+#define W_HONORABLEHORSE (HONORABLEHORSE | WHITE)
+#define W_DRAGONKING (DRAGONKING | WHITE)
+#define W_DRAGONHORSE (DRAGONHORSE | WHITE)
+#define W_LANCE (LANCE | WHITE)
+#define W_CANNON (CANNON | WHITE)
+#define W_SILVER (SILVER | WHITE)
+#define W_GOLD (GOLD | WHITE)
#define W_KING (KING | WHITE)
+#define W_MANDARIN (MANDARIN | WHITE)
+#define W_EMPRESS (EMPRESS | WHITE)
+#define W_PRINCESS (PRINCESS | WHITE)
+#define W_WOODY (WOODY | WHITE)
+#define W_MINISTER (MINISTER | WHITE)
+#define W_PRIESTESS (PRIESTESS | WHITE)
+#define W_MASTODON (MASTODON | WHITE)
+#define W_MAN2 (MAN2 | WHITE)
+#define W_NIGHTRIDER (NIGHTRIDER | WHITE)
#define B_PAWN (PAWN | BLACK)
#define B_KNIGHT (KNIGHT | BLACK)
#define B_BISHOP (BISHOP | BLACK)
#define B_ROOK (ROOK | BLACK)
+#define B_CARDINAL (CARDINAL | BLACK)
+#define B_MARSHALL (MARSHALL | BLACK)
+#define B_MAN (MAN | BLACK)
#define B_QUEEN (QUEEN | BLACK)
+#define B_ELEPHANT (ELEPHANT | BLACK)
+#define B_ALFIL (ALFIL | BLACK)
+#define B_FERZ (FERZ | BLACK)
+#define B_WAZIR (WAZIR | BLACK)
+#define B_ALFIL2 (ALFIL2 | BLACK)
+#define B_FERZ2 (FERZ2 | BLACK)
+#define B_AMAZON (AMAZON | BLACK)
+#define B_CENTAUR (CENTAUR | BLACK)
+#define B_HORSE (HORSE | BLACK)
+#define B_HONORABLEHORSE (HONORABLEHORSE | BLACK)
+#define B_DRAGONKING (DRAGONKING | BLACK)
+#define B_DRAGONHORSE (DRAGONHORSE | BLACK)
+#define B_LANCE (LANCE | BLACK)
+#define B_CANNON (CANNON | BLACK)
+#define B_SILVER (SILVER | BLACK)
+#define B_GOLD (GOLD | BLACK)
#define B_KING (KING | BLACK)
+#define B_MANDARIN (MANDARIN | BLACK)
+#define B_EMPRESS (EMPRESS | BLACK)
+#define B_PRINCESS (PRINCESS | BLACK)
+#define B_WOODY (WOODY | BLACK)
+#define B_MINISTER (MINISTER | BLACK)
+#define B_PRIESTESS (PRIESTESS | BLACK)
+#define B_MASTODON (MASTODON | BLACK)
+#define B_MAN2 (MAN2 | BLACK)
+#define B_NIGHTRIDER (NIGHTRIDER | BLACK)
#define isblack(p) ((p) & BLACK)
#define iswhite(p) (!isblack(p))
#define colorval(p) ((p) & 0x80)
#define square_color(r,f) ((((r)+(f)) & 0x01) ? BLACK : WHITE)
-extern int pieceValues[7];
+extern int pieceValues[KING+1];
+#define BW 12
+#define BH 10
/* Treated as [file][rank] */
-typedef int board_t[8][8];
+typedef int board_t[BW][BH];
GENSTRUCT struct game_state_t {
- int board[8][8];
+ int board[BW][BH];
/* for bughouse */
- int holding[2][5];
+ int holding[2][KING];
/* For castling */
- unsigned char wkmoved, wqrmoved, wkrmoved;
- unsigned char bkmoved, bqrmoved, bkrmoved;
+ char wkmoved, wqrmoved, wkrmoved;
+ char bkmoved, bqrmoved, bkrmoved;
/* for ep */
- int ep_possible[2][8];
+ int ep_possible[2][BW];
/* For draws */
int lastIrreversable;
int onMove;
int moveNum;
/* Game num not saved, must be restored when read */
int gameNum;
+ char royalKnight;
+ char capablancaPieces;
+ char pawnDblStep;
+ char ranks;
+ char files;
+ char holdings;
+ char drops;
+ char castlingStyle;
+ char palace;
+ char setup;
+ char bareKingLoses;
+ char stalemate;
+ char promoType;
+ char variant[20];
};
#define ALG_DROP -2
+#define ALG_CASTLE -3
/* bughouse: if a drop move, then fromFile is ALG_DROP and fromRank is piece */
/* these are used when examining a game */
int wTime;
int bTime;
+
+ /* [HGM] these are used for computer games */
+ float score;
+ int depth;
};
#define MoveToHalfMove( gs ) ((((gs)->moveNum - 1) * 2) + (((gs)->onMove == WHITE) ? 0 : 1))
extern const char *wpstring[];
extern const char *bpstring[];
+extern int kludgeFlag; // [HGM] setup: forces move nr to zero in board printing
+
/* the FEN for the default initial position */
#define INITIAL_FEN "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w"