diff options
author | Robby Zambito <contact@robbyzambito.me> | 2021-07-25 23:57:54 -0400 |
---|---|---|
committer | Robby Zambito <contact@robbyzambito.me> | 2021-07-25 23:57:54 -0400 |
commit | 284af628eee7e8661f117ca4cab698c24abf600f (patch) | |
tree | f8f3a8248f473baef091def8706fde0fba300425 /include | |
parent | 0642443e690b879e94b627597f624d5fd56db33d (diff) |
Replaced player_color type with equivalent player_color enum
Diffstat (limited to 'include')
-rw-r--r-- | include/othello.h | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/include/othello.h b/include/othello.h index ed25b6d..b9a8cf5 100644 --- a/include/othello.h +++ b/include/othello.h @@ -1,19 +1,21 @@ #include <stdbool.h> -typedef char player_color; -#define EMPTY (player_color)'*' -#define WHITE (player_color)'w' -#define BLACK (player_color)'b' +enum player_color { + EMPTY = '*', + WHITE = 'w', + BLACK = 'b', +}; struct move { int row; int col; }; -void initialize_board(player_color board[8][8]); -bool is_valid_move(const player_color board[8][8], - const player_color current_player, const struct move move); -bool has_valid_moves(const player_color board[8][8], - const player_color current_player); -player_color game_loop(player_color board[8][8]); -void print_board(const player_color board[8][8]); +void initialize_board(enum player_color board[8][8]); +bool is_valid_move(const enum player_color board[8][8], + const enum player_color current_player, + const struct move move); +bool has_valid_moves(const enum player_color board[8][8], + const enum player_color current_player); +enum player_color game_loop(enum player_color board[8][8]); +void print_board(const enum player_color board[8][8]); |