diff options
author | Robby Zambito <contact@robbyzambito.me> | 2022-01-18 22:37:04 -0500 |
---|---|---|
committer | Robby Zambito <contact@robbyzambito.me> | 2022-01-18 22:37:04 -0500 |
commit | c5c54396bdf8ef14c17a0bc5b8f0fda74aa958cf (patch) | |
tree | 55354c468cb60d52578f70b892f3f8ac885d6c2c /include/othello_move.h | |
parent | 59627145631f254191ce1b9de561c8ba0ddc889e (diff) |
* 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.
Diffstat (limited to 'include/othello_move.h')
-rw-r--r-- | include/othello_move.h | 6 |
1 files changed, 4 insertions, 2 deletions
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, |