diff options
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -445,6 +445,9 @@ int compute_score(int* board, int mobility, int mobility_color) { int white_material_advantage = compute_material_advantage(board, WHITE); + // If pre-computed mobility has not been passed, compute it + if (!mobility) mobility = list_available_moves(NULL, board, mobility_color); + int opponent_mobility = list_available_moves(NULL, board, mobility_color ^ 1); int white_mobility_advantage = (mobility - opponent_mobility) * (mobility_color == WHITE ? 1 : -1); @@ -590,6 +593,7 @@ int main() { apply_move(move, board); print_board(board); + printf("Current score: %i\n", compute_score(board, 0, WHITE)); color ^= 1; } |