summaryrefslogtreecommitdiff
path: root/src/initialize_board.c
blob: cfa92c1ce1db849765f8d12ee891e093b8a14a73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "othello.h"

void initialize_board(enum 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;
}