4. (21%) Consider a game on a SIZE \times SIZE board, where each cell may be either empty or occupied
by a black or white piece. In this game, when a cell is placed on the board, every cell of the opposite
color in the southeast direction up to the first cell that is either empty or the same color changes color.
For example, with SIZE = 8, the board is transformed as illustrated below if a white piece is placed
at row 6 column 2; no existing piece changes color if a black piece is placed at row 6 column 6 or row
7 column 6.
0 1 2 3 4 5 6 7
7
6
5
4
3
2
1
0
0 1 2 3 4 5 6 7
7
6
5
4
3
2
1
0
Write a function move that places a cell of color x on the board at position p, based on the declarations
and prototype below.
enum Cell {EMPTY, BLACK, WHITE};
Cell board[SIZE][SIZE]; // left dimension is row
struct Position {
int row;
int col;
};
Position pos;
void move(Cell x, Position p);