From 0ed931c4ff167c957c0b772b7d3c73a7e6dcb403 Mon Sep 17 00:00:00 2001 From: Robby Zambito Date: Sun, 21 Nov 2021 16:08:23 -0500 Subject: Added function pointer for getting the player move. If the player is an AI one, it will point to a function that will return the move from the AI. If the player is a human, it will point to a function that will prompt the user for input. --- src/game_loop.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/game_loop.c b/src/game_loop.c index 409e384..bcf7eb7 100644 --- a/src/game_loop.c +++ b/src/game_loop.c @@ -27,6 +27,11 @@ #define STREQ(a, b) (strcmp(a, b) == 0) +struct move (*player_one_get_move)(enum player_color board[8][8], + enum player_color current_player); +struct move (*player_two_get_move)(enum player_color board[8][8], + enum player_color current_player); + static enum player_color other_player(enum player_color current_player) { switch (current_player) { case WHITE: -- cgit v1.2.3