4 * ----------------------------------------------------------------------
5 * Copyright (c) 1993, 1994, 1995 Matthias Mutz
6 * Copyright (c) 1999 Michael Vanier and the Free Software Foundation
8 * GNU SHOGI is based on GNU CHESS
10 * Copyright (c) 1988, 1989, 1990 John Stanback
11 * Copyright (c) 1992 Free Software Foundation
13 * This file is part of GNU SHOGI.
15 * GNU Shogi is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by the
17 * Free Software Foundation; either version 3 of the License,
18 * or (at your option) any later version.
20 * GNU Shogi is distributed in the hope that it will be useful, but WITHOUT
21 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
22 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
25 * You should have received a copy of the GNU General Public License along
26 * with GNU Shogi; see the file COPYING. If not, see
27 * <http://www.gnu.org/licenses/>.
28 * ----------------------------------------------------------------------
35 short ahead = true, hash = true;
40 short FROMsquare, TOsquare;
42 small_short ChkFlag[MAXDEPTH], CptrFlag[MAXDEPTH], TesujiFlag[MAXDEPTH];
43 short Pscore[MAXDEPTH], Tscore[MAXDEPTH];
44 small_short Pindex[NO_SQUARES];
46 short mtl[2], hung[2];
47 small_short PieceCnt[2];
56 extern char *binbookfile;
59 extern char *bookfile;
61 unsigned long hashkey, hashbd;
66 short rpthash[2][256];
67 short TrPnt[MAXDEPTH];
68 small_short PieceList[2][NO_SQUARES];
69 small_short PawnCnt[2][NO_COLS];
70 small_short Captured[2][NO_PIECES];
71 small_short Mvboard[NO_SQUARES];
73 #if !defined SAVE_SVALUE
74 short svalue[NO_SQUARES];
79 short opponent, computer, WAwindow, WBwindow, BAwindow, BBwindow, dither,
81 long ResponseTime = 0, ExtraTime = 0, MaxResponseTime = 0,
82 et = 0, et0 = 0, time0 = 0, ft = 0;
88 long GenCnt, NodeCnt, ETnodes, EvalNodes, HashCnt, HashAdd,
89 FHashCnt, FHashAdd, HashCol, THashCol, filesz, hashmask, hashbase;
91 short HashDepth = HASHDEPTH, HashMoveLimit = HASHMOVELIMIT;
94 short Sdepth, Game50, MaxSearchDepth;
98 struct TimeControlRec TimeControl;
100 short TCflag, TCmoves, TCminutes, TCseconds, OperatorTime;
101 short XCmoves[3] = { 0, 0, 0 };
102 short XCminutes[3] = { 0, 0, 0 };
103 short XCseconds[3] = { 0, 0, 0 };
104 short XC = 0, XCmore = 0;
105 const short otherside[3] = { white, black, neutral };
107 short TOflag; /* force search re-init if we backup search */
109 unsigned short killr0[MAXDEPTH], killr1[MAXDEPTH];
110 unsigned short killr2[MAXDEPTH], killr3[MAXDEPTH];
111 unsigned short PV, SwagHt, Swag0, Swag1, Swag2, Swag3, Swag4, sidebit;
113 small_short HasPiece[2][NO_PIECES];
115 const short kingP[3] =
118 const small_short relative_value[NO_PIECES] =
130 const long control[NO_PIECES] =
135 ctlS, ctlG, ctlB, ctlR,
140 ctlSp, ctlBp, ctlRp, ctlK };
149 unsigned int starttime;
151 int timeopp[MINGAMEIN], timecomp[MINGAMEIN];
155 struct leaf *Tree = NULL;
157 hashcode_array *hashcode = NULL;
158 drop_hashcode_array *drop_hashcode = NULL;
160 struct leaf *root = NULL;
162 struct GameRec *GameList = NULL;
164 value_array *value = NULL;
165 fscore_array *fscore = NULL;
167 #ifndef SAVE_DISTDATA
168 short use_distdata = true;
169 distdata_array *distdata = NULL;
172 #ifndef SAVE_PTYPE_DISTDATA
173 short use_ptype_distdata = true;
174 distdata_array *ptype_distdata[NO_PTYPE_PIECES];
177 #if !defined SAVE_NEXTPOS
178 next_array *nextdir[NO_PTYPE_PIECES];
179 next_array *nextpos[NO_PTYPE_PIECES];
180 short use_nextpos = true;
184 short use_history = true;
185 unsigned short *history = NULL;
189 short use_etable = true;
190 etable_field *etab[2] = { NULL, NULL };
194 short use_ttable = true;
195 unsigned int ttblsize = ttblsz;
196 struct hashentry *ttable[2] = { NULL, NULL };
200 char *DRAW_REPETITION = "Repetition";
201 char *DRAW_MAXMOVES = "Max Moves";
202 char *DRAW_JUSTDRAW = "Drawn game!";