2 Stockfish, a UCI chess playing engine derived from Glaurung 2.1
3 Copyright (C) 2004-2008 Tord Romstad (Glaurung author)
4 Copyright (C) 2008-2010 Marco Costalba, Joona Kiiski, Tord Romstad
6 Stockfish is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 Stockfish is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #if !defined(PSQTAB_H_INCLUDED)
22 #define PSQTAB_H_INCLUDED
32 //// Constants modified by Joona Kiiski
35 static const Value MP = PawnValueMidgame;
36 static const Value MK = KnightValueMidgame;
37 static const Value MB = BishopValueMidgame;
38 static const Value MR = RookValueMidgame;
39 static const Value MQ = QueenValueMidgame;
41 static const int MgPST[][64] = {
45 0, 0, 0, 0, 0, 0, 0, 0,
46 MP-28, MP-6, MP+ 4, MP+14, MP+14, MP+ 4, MP-6, MP-28,
47 MP-28, MP-6, MP+ 9, MP+36, MP+36, MP+ 9, MP-6, MP-28,
48 MP-28, MP-6, MP+17, MP+58, MP+58, MP+17, MP-6, MP-28,
49 MP-28, MP-6, MP+17, MP+36, MP+36, MP+17, MP-6, MP-28,
50 MP-28, MP-6, MP+ 9, MP+14, MP+14, MP+ 9, MP-6, MP-28,
51 MP-28, MP-6, MP+ 4, MP+14, MP+14, MP+ 4, MP-6, MP-28,
52 0, 0, 0, 0, 0, 0, 0, 0
56 MK-135, MK-107, MK-80, MK-67, MK-67, MK-80, MK-107, MK-135,
57 MK- 93, MK- 67, MK-39, MK-25, MK-25, MK-39, MK- 67, MK- 93,
58 MK- 53, MK- 25, MK+ 1, MK+13, MK+13, MK+ 1, MK- 25, MK- 53,
59 MK- 25, MK+ 1, MK+27, MK+41, MK+41, MK+27, MK+ 1, MK- 25,
60 MK- 11, MK+ 13, MK+41, MK+55, MK+55, MK+41, MK+ 13, MK- 11,
61 MK- 11, MK+ 13, MK+41, MK+55, MK+55, MK+41, MK+ 13, MK- 11,
62 MK- 53, MK- 25, MK+ 1, MK+13, MK+13, MK+ 1, MK- 25, MK- 53,
63 MK-193, MK- 67, MK-39, MK-25, MK-25, MK-39, MK- 67, MK-193
67 MB-40, MB-40, MB-35, MB-30, MB-30, MB-35, MB-40, MB-40,
68 MB-17, MB+ 0, MB- 4, MB+ 0, MB+ 0, MB- 4, MB+ 0, MB-17,
69 MB-13, MB- 4, MB+ 8, MB+ 4, MB+ 4, MB+ 8, MB- 4, MB-13,
70 MB- 8, MB+ 0, MB+ 4, MB+17, MB+17, MB+ 4, MB+ 0, MB- 8,
71 MB- 8, MB+ 0, MB+ 4, MB+17, MB+17, MB+ 4, MB+ 0, MB- 8,
72 MB-13, MB- 4, MB+ 8, MB+ 4, MB+ 4, MB+ 8, MB- 4, MB-13,
73 MB-17, MB+ 0, MB- 4, MB+ 0, MB+ 0, MB- 4, MB+ 0, MB-17,
74 MB-17, MB-17, MB-13, MB- 8, MB- 8, MB-13, MB-17, MB-17
78 MR-12, MR-7, MR-2, MR+2, MR+2, MR-2, MR-7, MR-12,
79 MR-12, MR-7, MR-2, MR+2, MR+2, MR-2, MR-7, MR-12,
80 MR-12, MR-7, MR-2, MR+2, MR+2, MR-2, MR-7, MR-12,
81 MR-12, MR-7, MR-2, MR+2, MR+2, MR-2, MR-7, MR-12,
82 MR-12, MR-7, MR-2, MR+2, MR+2, MR-2, MR-7, MR-12,
83 MR-12, MR-7, MR-2, MR+2, MR+2, MR-2, MR-7, MR-12,
84 MR-12, MR-7, MR-2, MR+2, MR+2, MR-2, MR-7, MR-12,
85 MR-12, MR-7, MR-2, MR+2, MR+2, MR-2, MR-7, MR-12
89 MQ+8, MQ+8, MQ+8, MQ+8, MQ+8, MQ+8, MQ+8, MQ+8,
90 MQ+8, MQ+8, MQ+8, MQ+8, MQ+8, MQ+8, MQ+8, MQ+8,
91 MQ+8, MQ+8, MQ+8, MQ+8, MQ+8, MQ+8, MQ+8, MQ+8,
92 MQ+8, MQ+8, MQ+8, MQ+8, MQ+8, MQ+8, MQ+8, MQ+8,
93 MQ+8, MQ+8, MQ+8, MQ+8, MQ+8, MQ+8, MQ+8, MQ+8,
94 MQ+8, MQ+8, MQ+8, MQ+8, MQ+8, MQ+8, MQ+8, MQ+8,
95 MQ+8, MQ+8, MQ+8, MQ+8, MQ+8, MQ+8, MQ+8, MQ+8,
96 MQ+8, MQ+8, MQ+8, MQ+8, MQ+8, MQ+8, MQ+8, MQ+8
100 287, 311, 262, 214, 214, 262, 311, 287,
101 262, 287, 238, 190, 190, 238, 287, 262,
102 214, 238, 190, 142, 142, 190, 238, 214,
103 190, 214, 167, 119, 119, 167, 214, 190,
104 167, 190, 142, 94, 94, 142, 190, 167,
105 142, 167, 119, 69, 69, 119, 167, 142,
106 119, 142, 94, 46, 46, 94, 142, 119,
107 94, 119, 69, 21, 21, 69, 119, 94
111 static const Value EP = PawnValueEndgame;
112 static const Value EK = KnightValueEndgame;
113 static const Value EB = BishopValueEndgame;
114 static const Value ER = RookValueEndgame;
115 static const Value EQ = QueenValueEndgame;
117 static const int EgPST[][64] = {
121 0, 0, 0, 0, 0, 0, 0, 0,
122 EP-8, EP-8, EP-8, EP-8, EP-8, EP-8, EP-8, EP-8,
123 EP-8, EP-8, EP-8, EP-8, EP-8, EP-8, EP-8, EP-8,
124 EP-8, EP-8, EP-8, EP-8, EP-8, EP-8, EP-8, EP-8,
125 EP-8, EP-8, EP-8, EP-8, EP-8, EP-8, EP-8, EP-8,
126 EP-8, EP-8, EP-8, EP-8, EP-8, EP-8, EP-8, EP-8,
127 EP-8, EP-8, EP-8, EP-8, EP-8, EP-8, EP-8, EP-8,
128 0, 0, 0, 0, 0, 0, 0, 0
132 EK-104, EK-79, EK-55, EK-42, EK-42, EK-55, EK-79, EK-104,
133 EK- 79, EK-55, EK-30, EK-17, EK-17, EK-30, EK-55, EK- 79,
134 EK- 55, EK-30, EK- 6, EK+ 5, EK+ 5, EK- 6, EK-30, EK- 55,
135 EK- 42, EK-17, EK+ 5, EK+18, EK+18, EK+ 5, EK-17, EK- 42,
136 EK- 42, EK-17, EK+ 5, EK+18, EK+18, EK+ 5, EK-17, EK- 42,
137 EK- 55, EK-30, EK- 6, EK+ 5, EK+ 5, EK- 6, EK-30, EK- 55,
138 EK- 79, EK-55, EK-30, EK-17, EK-17, EK-30, EK-55, EK- 79,
139 EK-104, EK-79, EK-55, EK-42, EK-42, EK-55, EK-79, EK-104
143 EB-59, EB-42, EB-35, EB-26, EB-26, EB-35, EB-42, EB-59,
144 EB-42, EB-26, EB-18, EB-11, EB-11, EB-18, EB-26, EB-42,
145 EB-35, EB-18, EB-11, EB- 4, EB- 4, EB-11, EB-18, EB-35,
146 EB-26, EB-11, EB- 4, EB+ 4, EB+ 4, EB- 4, EB-11, EB-26,
147 EB-26, EB-11, EB- 4, EB+ 4, EB+ 4, EB- 4, EB-11, EB-26,
148 EB-35, EB-18, EB-11, EB- 4, EB- 4, EB-11, EB-18, EB-35,
149 EB-42, EB-26, EB-18, EB-11, EB-11, EB-18, EB-26, EB-42,
150 EB-59, EB-42, EB-35, EB-26, EB-26, EB-35, EB-42, EB-59
154 ER+3, ER+3, ER+3, ER+3, ER+3, ER+3, ER+3, ER+3,
155 ER+3, ER+3, ER+3, ER+3, ER+3, ER+3, ER+3, ER+3,
156 ER+3, ER+3, ER+3, ER+3, ER+3, ER+3, ER+3, ER+3,
157 ER+3, ER+3, ER+3, ER+3, ER+3, ER+3, ER+3, ER+3,
158 ER+3, ER+3, ER+3, ER+3, ER+3, ER+3, ER+3, ER+3,
159 ER+3, ER+3, ER+3, ER+3, ER+3, ER+3, ER+3, ER+3,
160 ER+3, ER+3, ER+3, ER+3, ER+3, ER+3, ER+3, ER+3,
161 ER+3, ER+3, ER+3, ER+3, ER+3, ER+3, ER+3, ER+3
165 EQ-80, EQ-54, EQ-42, EQ-30, EQ-30, EQ-42, EQ-54, EQ-80,
166 EQ-54, EQ-30, EQ-18, EQ- 6, EQ- 6, EQ-18, EQ-30, EQ-54,
167 EQ-42, EQ-18, EQ- 6, EQ+ 6, EQ+ 6, EQ- 6, EQ-18, EQ-42,
168 EQ-30, EQ- 6, EQ+ 6, EQ+18, EQ+18, EQ+ 6, EQ- 6, EQ-30,
169 EQ-30, EQ- 6, EQ+ 6, EQ+18, EQ+18, EQ+ 6, EQ- 6, EQ-30,
170 EQ-42, EQ-18, EQ- 6, EQ+ 6, EQ+ 6, EQ- 6, EQ-18, EQ-42,
171 EQ-54, EQ-30, EQ-18, EQ- 6, EQ- 6, EQ-18, EQ-30, EQ-54,
172 EQ-80, EQ-54, EQ-42, EQ-30, EQ-30, EQ-42, EQ-54, EQ-80
176 18, 77, 105, 135, 135, 105, 77, 18,
177 77, 135, 165, 193, 193, 165, 135, 77,
178 105, 165, 193, 222, 222, 193, 165, 105,
179 135, 193, 222, 251, 251, 222, 193, 135,
180 135, 193, 222, 251, 251, 222, 193, 135,
181 105, 165, 193, 222, 222, 193, 165, 105,
182 77, 135, 165, 193, 193, 165, 135, 77,
183 18, 77, 105, 135, 135, 105, 77, 18
188 #endif // !defined(PSQTAB_H_INCLUDED)