I think that my move ordering is quite good:
- Hash move
- Promotions
- Captures with SEE >= 0 (ordered by MVV/LVA)
- Killer moves
- Quiet moves (ordered by history, butterfly heuristics, counter moves history, and see)
- Captures with SEE < 0 (ordered by MVV/LVA)
(note that SEE is also used in quiet moves to penalize those that move a piece to a square where it can be captured).
Also, the number of Re-Searches is low:
Code: Select all
Null Window Searches: 3345957
Re-Searches: 984 (0.0294086%)
Code: Select all
int Negamax(Board *board, int depth, int alpha, int beta){
(...)
for (int i = 0; i < numberOfLegalMoves; i++){
Board newBoard = *board;
newBoard.makeMove(moves[i]);
int score;
if (i == 0) {
score = -NegaMax(&newBoard, depth - 1, -beta, -alpha);
} else {
Board boardForReSearch = newBoard;
score = -NegaMax(&newBoard, depth - 1, -alpha-1, -alpha);
if (score > alpha && beta - alpha > 1) { // Also tried (score > alpha && score < beta) but nothing changed
score = -NegaMax(&boardForReSearch, depth - 1, -beta, -alpha);
}
}
(...)
}
return alpha
}
PS: English is not my native language so i'm sorry if anything is wrong, but I hope I made myself clear.