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