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