Code: Select all
value = getHistoryScore(*mp->history, move, board->turn, 512);
value += abs(PSQTMidgame[board->squares[MoveFrom(move)]][MoveTo(move) ]);
value -= abs(PSQTMidgame[board->squares[MoveFrom(move)]][MoveFrom(move)]);
I've just got the following method to pass instead. It's almost like PSQT just for sorting, but much simpler.
Code: Select all
// Pawn, Knight, Bishop, Rook, Queen, King
static const int SortingTypes[KING+1] = {10, 8, 8, 4, 3, 1};
static const int SortingTable[SQUARE_NB] = {
0, 0, 0, 0, 0, 0, 0, 0,
1, 2, 2, 2, 2, 2, 2, 1,
1, 2, 4, 4, 4, 4, 2, 1,
1, 2, 4, 6, 6, 4, 2, 1,
1, 2, 4, 6, 6, 4, 2, 1,
1, 2, 4, 4, 4, 4, 2, 1,
1, 2, 2, 2, 2, 2, 2, 1,
0, 0, 0, 0, 0, 0, 0, 0,
};
value = getHistoryScore(*mp->history, move, board->turn, 256);
value += SortingTypes[PieceType(board->squares[MoveFrom(move)])] * SortingTable[MoveTo(move) ];
value -= SortingTypes[PieceType(board->squares[MoveFrom(move)])] * SortingTable[MoveFrom(move)];