diff options
Diffstat (limited to 'src/initialize_board.c')
-rw-r--r-- | src/initialize_board.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/initialize_board.c b/src/initialize_board.c new file mode 100644 index 0000000..0172bfb --- /dev/null +++ b/src/initialize_board.c @@ -0,0 +1,17 @@ +#include "othello.h" + +void initialize_board(player_color board[8][8]) { + + // Set all the positions to empty + for (int i = 0; i < 8; i++) { + for (int j = 0; j < 8; j++) { + board[i][j] = EMPTY; + } + } + + // Fill the starting positions + board[3][3] = WHITE; + board[3][4] = BLACK; + board[4][3] = BLACK; + board[4][4] = WHITE; +} |