summaryrefslogtreecommitdiff
path: root/include/othello.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/othello.h')
-rw-r--r--include/othello.h24
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]);