summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 81b751f..372c01e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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;
}