2006-02-22 14:24:54 +00:00
|
|
|
|
|
|
|
#ifndef _GNUCHESS_H_
|
|
|
|
#define _GNUCHESS_H_
|
2017-01-31 03:28:02 +00:00
|
|
|
#define MAX_GAME_CNT 256
|
2006-02-22 14:24:54 +00:00
|
|
|
#define neutral 2
|
|
|
|
#define white 0
|
2017-01-31 00:07:47 +00:00
|
|
|
#define black 1
|
2006-02-22 14:24:54 +00:00
|
|
|
#define no_piece 0
|
|
|
|
#define pawn 1
|
|
|
|
#define knight 2
|
|
|
|
#define bishop 3
|
|
|
|
#define rook 4
|
|
|
|
#define queen 5
|
|
|
|
#define king 6
|
|
|
|
#define valueP 100
|
|
|
|
#define valueN 350
|
|
|
|
#define valueB 355
|
|
|
|
#define valueR 550
|
|
|
|
#define valueQ 1100
|
|
|
|
#define valueK 1200
|
|
|
|
|
2006-03-14 20:55:59 +00:00
|
|
|
/* ---- chess engine global types ---- */
|
|
|
|
struct GameRec {
|
|
|
|
unsigned short gmove;
|
|
|
|
short score,depth,time,piece,color;
|
|
|
|
long nodes;
|
|
|
|
};
|
|
|
|
struct TimeControlRec {
|
|
|
|
short moves[2];
|
|
|
|
long clock[2];
|
|
|
|
};
|
|
|
|
|
|
|
|
/* ---- chess engine global variables ---- */
|
|
|
|
extern short mate,opponent,computer,Sdepth;
|
2006-02-22 14:24:54 +00:00
|
|
|
extern short locn[8][8];
|
|
|
|
extern short board[64];
|
|
|
|
extern short color[64];
|
2006-04-15 11:27:47 +00:00
|
|
|
extern bool withbook;
|
2006-02-22 14:24:54 +00:00
|
|
|
extern long Level;
|
|
|
|
extern short TCflag,TCmoves,TCminutes;
|
2006-03-03 15:01:37 +00:00
|
|
|
extern short timeout;
|
2017-01-31 03:28:02 +00:00
|
|
|
extern unsigned char GameCnt; /* Bug fix rolls over at 255 instead of overflow */
|
|
|
|
extern short Game50,castld[2],kingmoved[2],OperatorTime;
|
2006-03-14 20:55:59 +00:00
|
|
|
extern struct TimeControlRec TimeControl;
|
2017-01-31 03:28:02 +00:00
|
|
|
extern struct GameRec GameList[MAX_GAME_CNT];
|
2006-02-22 14:24:54 +00:00
|
|
|
|
2006-02-23 21:16:51 +00:00
|
|
|
/* ---- The beginning of a GNUChess v2 APIfication ---- */
|
2006-02-22 14:24:54 +00:00
|
|
|
void SetTimeControl(void);
|
|
|
|
void GNUChess_Initialize(void);
|
2007-09-02 10:11:46 +00:00
|
|
|
int VerifyMove(short player, char s[],short iop,unsigned short *mv, char *move_buffer);
|
2007-05-29 16:33:16 +00:00
|
|
|
int SelectMove ( short side, short iop , void (*callback)(void), char *move_buffer );
|
2006-03-14 20:55:59 +00:00
|
|
|
void InitializeStats ( void );
|
2007-08-03 21:59:41 +00:00
|
|
|
void ElapsedTime ( short iop );
|
2006-02-22 14:24:54 +00:00
|
|
|
|
|
|
|
#endif
|