b9bc0627e2eccf4bf99ca55b4f3c3769d6dd7b91
[gnushogi.git] / gnushogi / eval.h
1 /*
2  * FILE: eval.h
3  *
4  *     Interface to the board evaluator.
5  *
6  * ----------------------------------------------------------------------
7  * Copyright (c) 1993, 1994, 1995 Matthias Mutz
8  * Copyright (c) 1999 Michael Vanier and the Free Software Foundation
9  *
10  * GNU SHOGI is based on GNU CHESS
11  *
12  * Copyright (c) 1988, 1989, 1990 John Stanback
13  * Copyright (c) 1992 Free Software Foundation
14  *
15  * This file is part of GNU SHOGI.
16  *
17  * GNU Shogi is free software; you can redistribute it and/or modify it
18  * under the terms of the GNU General Public License as published by the
19  * Free Software Foundation; either version 3 of the License,
20  * or (at your option) any later version.
21  *
22  * GNU Shogi is distributed in the hope that it will be useful, but WITHOUT
23  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
24  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
25  * for more details.
26  *
27  * You should have received a copy of the GNU General Public License along
28  * with GNU Shogi; see the file COPYING. If not, see
29  * <http://www.gnu.org/licenses/>.
30  * ----------------------------------------------------------------------
31  *
32  */
33
34
35 #ifndef _EVAL_H_
36 #define _EVAL_H_
37
38 #define NO_STAGES 100
39 #define NO_FEATURES 31
40
41
42 struct signature
43 {
44     unsigned long hashbd;
45     unsigned long hashkey;
46 };
47
48 #define MatchSignature(s) ((s.hashbd == hashbd) && (s.hashkey == hashkey))
49 #define CopySignature(s)  { s.hashbd = hashbd; s.hashkey = hashkey; }
50
51 typedef short        value_array[NO_STAGES][NO_PIECES];
52 typedef small_short fscore_array[NO_STAGES][NO_FEATURES][2];
53
54 extern value_array  *value;
55 extern fscore_array *fscore;
56
57 extern void threats (short side);
58
59 extern long attack[2][NO_SQUARES];
60 extern small_short sseed[NO_SQUARES];
61
62 extern struct signature threats_signature[2];
63
64 extern small_short starget[2][NO_SQUARES];
65 extern small_short sloose[NO_SQUARES];
66 extern small_short shole[NO_SQUARES];
67 extern small_short shung[NO_SQUARES];
68
69 extern struct signature squares_signature;
70
71 #endif /* _EVAL_H_ */