diff options
author | eug-vs <eugene@eug-vs.xyz> | 2022-09-05 01:55:43 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2022-09-05 01:55:43 +0300 |
commit | 9e2ecdff65a73cc4e38b8cb35503363097acb863 (patch) | |
tree | f616177d2eb396d2906882425636135d36449161 | |
parent | 7259cb839abc42142ad88e237b2561a62058f961 (diff) | |
download | c-chess-9e2ecdff65a73cc4e38b8cb35503363097acb863.tar.gz |
fix: pass new move_hash down to minimax tree
-rw-r--r-- | src/main.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -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) { |