summaryrefslogtreecommitdiff
path: root/src/initialize_board.c
blob: 0172bfb74951eb796ec242ddc603eeb2b4f6c03a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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;
}