X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fpsqtab.h;h=4957fc7d8f646d1f6e3bdf5258ba2262ffa5c88f;hp=48d6f137f1b8890ba549d006983d7bcea90a76d4;hb=2d635f7b74fddccf82b7ca30442bbc2e3cd2f0b1;hpb=c7843f2f79c23144842b462c7dee7da2615b12ed diff --git a/src/psqtab.h b/src/psqtab.h index 48d6f137..4957fc7d 100644 --- a/src/psqtab.h +++ b/src/psqtab.h @@ -1,7 +1,7 @@ /* Stockfish, a UCI chess playing engine derived from Glaurung 2.1 Copyright (C) 2004-2008 Tord Romstad (Glaurung author) - Copyright (C) 2008-2009 Marco Costalba + Copyright (C) 2008-2010 Marco Costalba, Joona Kiiski, Tord Romstad Stockfish is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,160 +29,135 @@ //// -//// Constants modified by Joona Kiiski +//// Values tuned by Joona Kiiski //// -static const Value MP = PawnValueMidgame; -static const Value MK = KnightValueMidgame; -static const Value MB = BishopValueMidgame; -static const Value MR = RookValueMidgame; -static const Value MQ = QueenValueMidgame; - -static const int MgPST[][64] = { - { }, - {// Pawn - // A B C D E F G H - 0, 0, 0, 0, 0, 0, 0, 0, - MP-34, MP-12, MP- 2, MP+ 8, MP+ 8, MP- 2, MP-12, MP-34, - MP-34, MP-12, MP+ 3, MP+30, MP+30, MP+ 3, MP-12, MP-34, - MP-34, MP-12, MP+11, MP+52, MP+52, MP+11, MP-12, MP-34, - MP-34, MP-12, MP+11, MP+30, MP+30, MP+11, MP-12, MP-34, - MP-34, MP-12, MP+ 3, MP+ 8, MP+ 8, MP+ 3, MP-12, MP-34, - MP-34, MP-12, MP- 2, MP+ 8, MP+ 8, MP- 2, MP-12, MP-34, - 0, 0, 0, 0, 0, 0, 0, 0 +static const int MgPST[][64] = { // [piece][square] + {}, + { // Pawn + 4, 5, 7, 8, 8, 7, 5, 4, + 162, 183, 194, 204, 204, 194, 183, 162, + 164, 185, 201, 227, 227, 201, 185, 164, + 165, 186, 210, 247, 247, 210, 186, 165, + 166, 187, 211, 229, 229, 211, 187, 166, + 167, 188, 204, 209, 209, 204, 188, 167, + 168, 189, 200, 210, 210, 200, 189, 168, + 8, 9, 11, 12, 12, 11, 9, 8 }, - {// Knight - // A B C D E F G H - MK-136, MK-108, MK-81, MK-68, MK-68, MK-81, MK-108, MK-136, - MK- 94, MK- 68, MK-40, MK-26, MK-26, MK-40, MK- 68, MK- 94, - MK- 54, MK- 26, MK+ 0, MK+12, MK+12, MK+ 0, MK- 26, MK- 54, - MK- 26, MK+ 0, MK+26, MK+40, MK+40, MK+26, MK+ 0, MK- 26, - MK- 12, MK+ 12, MK+40, MK+54, MK+54, MK+40, MK+ 12, MK- 12, - MK- 12, MK+ 12, MK+40, MK+54, MK+54, MK+40, MK+ 12, MK- 12, - MK- 54, MK- 26, MK+ 0, MK+12, MK+12, MK+ 0, MK- 26, MK- 54, - MK-194, MK- 68, MK-40, MK-26, MK-26, MK-40, MK- 68, MK-194 + { // Knight + 675, 709, 742, 759, 759, 742, 709, 675, + 721, 752, 785, 802, 802, 785, 752, 721, + 765, 797, 827, 841, 841, 827, 797, 765, + 794, 823, 853, 869, 869, 853, 823, 794, + 808, 834, 865, 881, 881, 865, 834, 808, + 807, 833, 864, 879, 879, 864, 833, 807, + 764, 794, 823, 837, 837, 823, 794, 764, + 624, 752, 783, 799, 799, 783, 752, 624 }, - {// Bishop - // A B C D E F G H - MB-41, MB-41, MB-36, MB-31, MB-31, MB-36, MB-41, MB-41, - MB-18, MB- 1, MB- 5, MB- 1, MB- 1, MB- 5, MB- 1, MB-18, - MB-14, MB- 5, MB+ 7, MB+ 3, MB+ 3, MB+ 7, MB- 5, MB-14, - MB- 9, MB- 1, MB+ 3, MB+16, MB+16, MB+ 3, MB- 1, MB- 9, - MB- 9, MB- 1, MB+ 3, MB+16, MB+16, MB+ 3, MB- 1, MB- 9, - MB-14, MB- 5, MB+ 7, MB+ 3, MB+ 3, MB+ 7, MB- 5, MB-14, - MB-18, MB- 1, MB- 5, MB- 1, MB- 1, MB- 5, MB- 1, MB-18, - MB-18, MB-18, MB-14, MB- 9, MB- 9, MB-14, MB-18, MB-18 + { // Bishop + 795, 792, 796, 800, 800, 796, 792, 795, + 824, 845, 841, 844, 844, 841, 845, 824, + 830, 841, 855, 848, 848, 855, 841, 830, + 835, 844, 848, 867, 867, 848, 844, 835, + 834, 843, 847, 866, 866, 847, 843, 834, + 827, 838, 852, 845, 845, 852, 838, 827, + 821, 841, 837, 840, 840, 837, 841, 821, + 821, 820, 824, 830, 830, 824, 820, 821 }, - {// Rook - // A B C D E F G H - MR-14, MR-9, MR-4, MR-0, MR-0, MR-4, MR-9, MR-14, - MR-14, MR-9, MR-4, MR-0, MR-0, MR-4, MR-9, MR-14, - MR-14, MR-9, MR-4, MR-0, MR-0, MR-4, MR-9, MR-14, - MR-14, MR-9, MR-4, MR-0, MR-0, MR-4, MR-9, MR-14, - MR-14, MR-9, MR-4, MR-0, MR-0, MR-4, MR-9, MR-14, - MR-14, MR-9, MR-4, MR-0, MR-0, MR-4, MR-9, MR-14, - MR-14, MR-9, MR-4, MR-0, MR-0, MR-4, MR-9, MR-14, - MR-14, MR-9, MR-4, MR-0, MR-0, MR-4, MR-9, MR-14 + { // Rook + 1258, 1263, 1268, 1272, 1272, 1268, 1263, 1258, + 1258, 1263, 1268, 1272, 1272, 1268, 1263, 1258, + 1258, 1263, 1268, 1272, 1272, 1268, 1263, 1258, + 1258, 1263, 1268, 1272, 1272, 1268, 1263, 1258, + 1258, 1263, 1268, 1272, 1272, 1268, 1263, 1258, + 1258, 1263, 1268, 1272, 1272, 1268, 1263, 1258, + 1258, 1263, 1268, 1272, 1272, 1268, 1263, 1258, + 1258, 1263, 1268, 1272, 1272, 1268, 1263, 1258 }, - {// Queen - // A B C D E F G H - MQ+12, MQ+12, MQ+12, MQ+12, MQ+12, MQ+12, MQ+12, MQ+12, - MQ+12, MQ+12, MQ+12, MQ+12, MQ+12, MQ+12, MQ+12, MQ+12, - MQ+12, MQ+12, MQ+12, MQ+12, MQ+12, MQ+12, MQ+12, MQ+12, - MQ+12, MQ+12, MQ+12, MQ+12, MQ+12, MQ+12, MQ+12, MQ+12, - MQ+12, MQ+12, MQ+12, MQ+12, MQ+12, MQ+12, MQ+12, MQ+12, - MQ+12, MQ+12, MQ+12, MQ+12, MQ+12, MQ+12, MQ+12, MQ+12, - MQ+12, MQ+12, MQ+12, MQ+12, MQ+12, MQ+12, MQ+12, MQ+12, - MQ+12, MQ+12, MQ+12, MQ+12, MQ+12, MQ+12, MQ+12, MQ+12 + { // Queen + 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, + 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, + 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, + 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, + 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, + 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, + 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529, + 2529, 2529, 2529, 2529, 2529, 2529, 2529, 2529 }, - {// King - //A B C D E F G H - 302, 328, 276, 225, 225, 276, 328, 302, - 276, 302, 251, 200, 200, 251, 302, 276, - 225, 251, 200, 149, 149, 200, 251, 225, - 200, 225, 175, 124, 124, 175, 225, 200, - 175, 200, 149, 98, 98, 149, 200, 175, - 149, 175, 124, 72, 72, 124, 175, 149, - 124, 149, 98, 47, 47, 98, 149, 124, - 98, 124, 72, 21, 21, 72, 124, 98 + { // King + 287, 311, 262, 214, 214, 262, 311, 287, + 262, 287, 238, 190, 190, 238, 287, 262, + 214, 238, 190, 142, 142, 190, 238, 214, + 190, 214, 167, 119, 119, 167, 214, 190, + 167, 190, 142, 94, 94, 142, 190, 167, + 142, 167, 119, 69, 69, 119, 167, 142, + 119, 142, 94, 46, 46, 94, 142, 119, + 94, 119, 69, 21, 21, 69, 119, 94 } }; -static const Value EP = PawnValueEndgame; -static const Value EK = KnightValueEndgame; -static const Value EB = BishopValueEndgame; -static const Value ER = RookValueEndgame; -static const Value EQ = QueenValueEndgame; - -static const int EgPST[][64] = { - { }, - {// Pawn - // A B C D E F G H - 0, 0, 0, 0, 0, 0, 0, 0, - EP-7, EP-7, EP-7, EP-7, EP-7, EP-7, EP-7, EP-7, - EP-7, EP-7, EP-7, EP-7, EP-7, EP-7, EP-7, EP-7, - EP-7, EP-7, EP-7, EP-7, EP-7, EP-7, EP-7, EP-7, - EP-7, EP-7, EP-7, EP-7, EP-7, EP-7, EP-7, EP-7, - EP-7, EP-7, EP-7, EP-7, EP-7, EP-7, EP-7, EP-7, - EP-7, EP-7, EP-7, EP-7, EP-7, EP-7, EP-7, EP-7, - 0, 0, 0, 0, 0, 0, 0, 0 +static const int EgPST[][64] = { // [piece][square] + {}, + { // Pawn + 2, 0, -2, -4, -4, -2, 0, 2, + 253, 251, 249, 247, 247, 249, 251, 253, + 253, 251, 249, 247, 247, 249, 251, 253, + 253, 251, 249, 247, 247, 249, 251, 253, + 254, 252, 250, 248, 248, 250, 252, 254, + 254, 252, 250, 248, 248, 250, 252, 254, + 254, 252, 250, 248, 248, 250, 252, 254, + 4, 2, 0, -2, -2, 0, 2, 4 }, - {// Knight - // A B C D E F G H - EK-104, EK-79, EK-55, EK-42, EK-42, EK-55, EK-79, EK-104, - EK- 79, EK-55, EK-30, EK-17, EK-17, EK-30, EK-55, EK- 79, - EK- 55, EK-30, EK- 6, EK+ 5, EK+ 5, EK- 6, EK-30, EK- 55, - EK- 42, EK-17, EK+ 5, EK+18, EK+18, EK+ 5, EK-17, EK- 42, - EK- 42, EK-17, EK+ 5, EK+18, EK+18, EK+ 5, EK-17, EK- 42, - EK- 55, EK-30, EK- 6, EK+ 5, EK+ 5, EK- 6, EK-30, EK- 55, - EK- 79, EK-55, EK-30, EK-17, EK-17, EK-30, EK-55, EK- 79, - EK-104, EK-79, EK-55, EK-42, EK-42, EK-55, EK-79, EK-104 + { // Knight + 741, 765, 791, 806, 806, 791, 765, 741, + 766, 790, 818, 834, 834, 818, 790, 766, + 790, 816, 844, 858, 858, 844, 816, 790, + 803, 830, 855, 873, 873, 855, 830, 803, + 803, 830, 855, 873, 873, 855, 830, 803, + 790, 816, 844, 858, 858, 844, 816, 790, + 766, 790, 818, 834, 834, 818, 790, 766, + 741, 765, 791, 806, 806, 791, 765, 741 }, - {// Bishop - // A B C D E F G H - EB-56, EB-39, EB-32, EB-23, EB-23, EB-32, EB-39, EB-56, - EB-39, EB-23, EB-15, EB- 8, EB- 8, EB-15, EB-23, EB-39, - EB-32, EB-15, EB- 8, EB- 1, EB- 1, EB- 8, EB-15, EB-32, - EB-23, EB- 8, EB- 1, EB+ 7, EB+ 7, EB- 1, EB- 8, EB-23, - EB-23, EB- 8, EB- 1, EB+ 7, EB+ 7, EB- 1, EB- 8, EB-23, - EB-32, EB-15, EB- 8, EB- 1, EB- 1, EB- 8, EB-15, EB-32, - EB-39, EB-23, EB-15, EB- 8, EB- 8, EB-15, EB-23, EB-39, - EB-56, EB-39, EB-32, EB-23, EB-23, EB-32, EB-39, EB-56 + { // Bishop + 798, 816, 826, 836, 836, 826, 816, 798, + 814, 831, 841, 849, 849, 841, 831, 814, + 820, 838, 847, 856, 856, 847, 838, 820, + 829, 845, 855, 865, 865, 855, 845, 829, + 830, 846, 856, 866, 866, 856, 846, 830, + 821, 840, 850, 859, 859, 850, 840, 821, + 815, 833, 844, 853, 853, 844, 833, 815, + 798, 817, 828, 839, 839, 828, 817, 798 }, - {// Rook - // A B C D E F G H - ER+1, ER+1, ER+1, ER+1, ER+1, ER+1, ER+1, ER+1, - ER+1, ER+1, ER+1, ER+1, ER+1, ER+1, ER+1, ER+1, - ER+1, ER+1, ER+1, ER+1, ER+1, ER+1, ER+1, ER+1, - ER+1, ER+1, ER+1, ER+1, ER+1, ER+1, ER+1, ER+1, - ER+1, ER+1, ER+1, ER+1, ER+1, ER+1, ER+1, ER+1, - ER+1, ER+1, ER+1, ER+1, ER+1, ER+1, ER+1, ER+1, - ER+1, ER+1, ER+1, ER+1, ER+1, ER+1, ER+1, ER+1, - ER+1, ER+1, ER+1, ER+1, ER+1, ER+1, ER+1, ER+1 + { // Rook + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281 }, - {// Queen - // A B C D E F G H - EQ-77, EQ-51, EQ-39, EQ-27, EQ-27, EQ-39, EQ-51, EQ-77, - EQ-51, EQ-27, EQ-15, EQ- 3, EQ- 3, EQ-15, EQ-27, EQ-51, - EQ-39, EQ-15, EQ- 3, EQ+ 9, EQ+ 9, EQ- 3, EQ-15, EQ-39, - EQ-27, EQ- 3, EQ+ 9, EQ+21, EQ+21, EQ+ 9, EQ- 3, EQ-27, - EQ-27, EQ- 3, EQ+ 9, EQ+21, EQ+21, EQ+ 9, EQ- 3, EQ-27, - EQ-39, EQ-15, EQ- 3, EQ+ 9, EQ+ 9, EQ- 3, EQ-15, EQ-39, - EQ-51, EQ-27, EQ-15, EQ- 3, EQ- 3, EQ-15, EQ-27, EQ-51, - EQ-77, EQ-51, EQ-39, EQ-27, EQ-27, EQ-39, EQ-51, EQ-77 + { // Queen + 2478, 2504, 2516, 2528, 2528, 2516, 2504, 2478, + 2504, 2528, 2540, 2552, 2552, 2540, 2528, 2504, + 2516, 2540, 2552, 2564, 2564, 2552, 2540, 2516, + 2528, 2552, 2564, 2576, 2576, 2564, 2552, 2528, + 2528, 2552, 2564, 2576, 2576, 2564, 2552, 2528, + 2516, 2540, 2552, 2564, 2564, 2552, 2540, 2516, + 2504, 2528, 2540, 2552, 2552, 2540, 2528, 2504, + 2478, 2504, 2516, 2528, 2528, 2516, 2504, 2478 }, - {// King - //A B C D E F G H - 16, 78, 108, 139, 139, 108, 78, 16, - 78, 139, 170, 200, 200, 170, 139, 78, - 108, 170, 200, 230, 230, 200, 170, 108, - 139, 200, 230, 261, 261, 230, 200, 139, - 139, 200, 230, 261, 261, 230, 200, 139, - 108, 170, 200, 230, 230, 200, 170, 108, - 78, 139, 170, 200, 200, 170, 139, 78, - 16, 78, 108, 139, 139, 108, 78, 16 + { // King + 18, 77, 105, 135, 135, 105, 77, 18, + 77, 135, 165, 193, 193, 165, 135, 77, + 105, 165, 193, 222, 222, 193, 165, 105, + 135, 193, 222, 251, 251, 222, 193, 135, + 135, 193, 222, 251, 251, 222, 193, 135, + 105, 165, 193, 222, 222, 193, 165, 105, + 77, 135, 165, 193, 193, 165, 135, 77, + 18, 77, 105, 135, 135, 105, 77, 18 } }; - #endif // !defined(PSQTAB_H_INCLUDED)