Simple quiet move sorting
Posted: Sat Jan 13, 2018 9:55 am
So my current (not for long) method of sorting quietsis the following
Basically just take the history score and add a little more/less based on PSQT
I've just got the following method to pass instead. It's almost like PSQT just for sorting, but much simpler.
Seems to beworth 7-10 elo @ 20+.02s. And I would say this is a method you could recommend to people just starting to do quiet move sorting. I'm sure this is not some new knowledge for sorting, but I have not seen this method on the forms or CPW.
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)];