From 233750ab72abb2101a9b35211b90c0318020b2c9 Mon Sep 17 00:00:00 2001 From: Robby Zambito Date: Sun, 23 Jan 2022 17:13:28 -0500 Subject: Highlight the previous move. This is particularly helpful when using the game to play on a real board --- include/othello_board.h | 2 +- include/othello_move.h | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/othello_board.h b/include/othello_board.h index 99ad839..a8299fc 100644 --- a/include/othello_board.h +++ b/include/othello_board.h @@ -32,7 +32,7 @@ enum player_color **copy_board(enum player_color **board); void free_board(enum player_color **board); // Prints the current state of the board, including coordinates in the margins. -void print_board(enum player_color **board); +void print_board(enum player_color **board, struct move *highlighted_moves, size_t highlighted_moves_length); void scm_print_board(SCM board); // Returns the current board. diff --git a/include/othello_move.h b/include/othello_move.h index a1f030d..6b58bbe 100644 --- a/include/othello_move.h +++ b/include/othello_move.h @@ -22,7 +22,9 @@ #include "othello.h" -struct move prompt_get_move(enum player_color current_player); +struct move prompt_get_move(enum player_color current_player, + struct move *flipped_last_turn, + size_t flipped_last_turn_length); struct move get_scm_move(char *strategy_path); // True if move is valid for current_player. @@ -41,8 +43,9 @@ bool has_valid_moves(enum player_color **board, // Returns non-zero number if the move was valid. // Returns the number of flipped tiles. -int apply_move(enum player_color **board, enum player_color current_player, - struct move move); +size_t apply_move(enum player_color **board, enum player_color current_player, + struct move move, struct move **flipped_spots, + size_t *flipped_spots_capacity); // Does not actually modify the current board state. Returns a new board with // the move applied. If the move was not valid, an empty list (nil) is returned. SCM scm_apply_move(SCM move, SCM board, SCM current_player); -- cgit v1.2.3