diff options
-rw-r--r-- | include/othello.h | 6 | ||||
-rw-r--r-- | src/game_loop.c | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/include/othello.h b/include/othello.h index 6c27c46..cd3dbac 100644 --- a/include/othello.h +++ b/include/othello.h @@ -33,6 +33,12 @@ struct move { int col; }; +// Function pointers for each players move function +extern struct move (*player_one_get_move)(enum player_color board[8][8], + enum player_color current_player); +extern struct move (*player_two_get_move)(enum player_color board[8][8], + enum player_color current_player); + // Set a board to a new game state. void initialize_board(enum player_color board[8][8]); 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: |