diff options
author | Robby Zambito <contact@robbyzambito.me> | 2021-12-29 22:39:07 -0500 |
---|---|---|
committer | Robby Zambito <contact@robbyzambito.me> | 2021-12-29 22:49:59 -0500 |
commit | b9113f203b831e8d4f7cfeeff4701b07da0ea44e (patch) | |
tree | f0bb9cb7d900a388d0db6e1e2671583c12f5360f /include | |
parent | ab8cf4fab8a83b95f66ed8c0d76ec2200a23c847 (diff) |
Do not pass board around
Instead use the get_board() function to get a reference to the board.
Diffstat (limited to 'include')
-rw-r--r-- | include/othello.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/include/othello.h b/include/othello.h index e6c7796..acf09a0 100644 --- a/include/othello.h +++ b/include/othello.h @@ -40,24 +40,22 @@ 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]); +void initialize_board(enum player_color ***board); // True if move is valid for current_player. // Otherwise false. -bool is_valid_move(enum player_color board[8][8], - const enum player_color current_player, +bool is_valid_move(const enum player_color current_player, const struct move move); // True if current_player has any valid moves. // Otherwise false. -bool has_valid_moves(enum player_color board[8][8], - const enum player_color current_player); +bool has_valid_moves(const enum player_color current_player); // Plays a game to completion, starting with board. -enum player_color game_loop(enum player_color board[8][8]); +enum player_color game_loop(void); // Prints the current state of the board, including coordinates in the margins. -void print_board(enum player_color board[8][8]); +void print_board(void); // Returns the color of the player whose turn it is. enum player_color get_current_player(void); |