summaryrefslogtreecommitdiff
path: root/src/game_loop.c
diff options
context:
space:
mode:
authorRobby Zambito <contact@robbyzambito.me>2022-01-21 17:49:09 -0500
committerRobby Zambito <contact@robbyzambito.me>2022-01-21 17:49:09 -0500
commita5706c0be5778b911b061deca501271fc2bf2c07 (patch)
tree1087eb740715e692820ff1e275cf61a7ca1b0ea8 /src/game_loop.c
parent199b2ff1b66bf2e12c9bf0b55a895a5555cc52f7 (diff)
Add command line argument to print the final board as a scheme object
This could be useful to create a machine learning AI, which uses the final board for training. Also bubble up the final score and present it at the end of the game.
Diffstat (limited to 'src/game_loop.c')
-rw-r--r--src/game_loop.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/game_loop.c b/src/game_loop.c
index f52bdb7..2c70ce2 100644
--- a/src/game_loop.c
+++ b/src/game_loop.c
@@ -76,7 +76,8 @@ static struct move current_player_move(enum player_color current_player,
}
enum player_color game_loop(char *player_one_strategy_path,
- char *player_two_strategy_path) {
+ char *player_two_strategy_path, int *white_score,
+ int *black_score) {
initialize_board();
if (player_one_strategy_path == NULL || player_two_strategy_path == NULL) {
@@ -100,5 +101,5 @@ enum player_color game_loop(char *player_one_strategy_path,
rl_clear_history();
}
- return get_winner(get_board(), current_player, NULL, NULL);
+ return get_winner(get_board(), current_player, white_score, black_score);
}