summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRobby Zambito <contact@robbyzambito.me>2022-01-23 17:13:28 -0500
committerRobby Zambito <contact@robbyzambito.me>2022-01-23 17:13:28 -0500
commit233750ab72abb2101a9b35211b90c0318020b2c9 (patch)
tree7d6e68518896ddd97b841570d1e417b2ce0c70a2 /include
parentb2ab3b9466dc7d4d46795baa956a985cfdfd701d (diff)
Highlight the previous move.
This is particularly helpful when using the game to play on a real board
Diffstat (limited to 'include')
-rw-r--r--include/othello_board.h2
-rw-r--r--include/othello_move.h9
2 files changed, 7 insertions, 4 deletions
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);