From 9e2ecdff65a73cc4e38b8cb35503363097acb863 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Mon, 5 Sep 2022 01:55:43 +0300 Subject: fix: pass new move_hash down to minimax tree --- src/main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 25a6a2f..c1c7ee8 100644 --- a/src/main.c +++ b/src/main.c @@ -543,17 +543,17 @@ int evaluate_position(int* board, int precomputed_mobility, int mobility_color) int get_piece_raw_value(int piece) { switch (piece & NO_COLOR) { case KNIGHT: - return 3; + return 30; case BISHOP: - return 3; + return 30; case ROOK: - return 5; + return 50; case QUEEN: - return 9; + return 90; case KING: return INFINITY; case PAWN: - return 1; + return 10; default: return 0; } @@ -575,7 +575,7 @@ int order_moves(Move* moves, int moves_count, int* board, long hash, Transpositi } else { int origin_value = get_piece_raw_value(board[moves[i].origin]); int destination_value = get_piece_raw_value(board[moves[i].destination]); - moves[i].value = 10 * destination_value - origin_value; + moves[i].value = 2 * destination_value - origin_value; } } @@ -610,7 +610,7 @@ Move minimax_search(int* board, int color, int depth, int alpha, int beta, int* int captured_piece = make_move(move, board); move.value = depth > 0 - ? minimax_search(board, 1 - color, depth - 1, alpha, beta, metrics, hash, transposition_table, zobrist_seed).value + ? minimax_search(board, 1 - color, depth - 1, alpha, beta, metrics, move_hash, transposition_table, zobrist_seed).value : evaluate_position(board, available_moves_count, color); if (transposition_table[move_hash].depth < depth) { -- cgit v1.2.3