From c5c54396bdf8ef14c17a0bc5b8f0fda74aa958cf Mon Sep 17 00:00:00 2001 From: Robby Zambito Date: Tue, 18 Jan 2022 22:37:04 -0500 Subject: * Made print_board accept a board to print. * free_board should not return anything. * is_valid_move and has_valid_moves accept a board. * Implemented primitives for Scheme strategies to get the current player, and to get the board, and the validity of a move. * Removed game logic from is_valid_move. Instead simply apply the move to a temp board, and see if the move worked. * Created a very simple strategy for testing these primitives. It only hardcodes the first move, and then fails since that move is no longer valid. --- include/othello_move.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/othello_move.h') diff --git a/include/othello_move.h b/include/othello_move.h index 0c3716e..281cb9b 100644 --- a/include/othello_move.h +++ b/include/othello_move.h @@ -27,12 +27,14 @@ struct move get_scm_move(char *strategy_path); // True if move is valid for current_player. // Otherwise false. -bool is_valid_move(const enum player_color current_player, +bool is_valid_move(enum player_color **board, + const enum player_color current_player, const struct move move); // True if current_player has any valid moves. // Otherwise false. -bool has_valid_moves(const enum player_color current_player); +bool has_valid_moves(enum player_color **board, + const enum player_color current_player); /* Returns true if the move was valid */ bool apply_move(enum player_color **board, enum player_color current_player, -- cgit v1.2.3