for (y = 0; y < DVONN_BOARD_Y_SIZE; y++) {
board->cells[x][y].type = DVONN_CELL_EMPTY;
board->cells[x][y].height = 0;
+ board->cells[x][y].contains_red = FALSE;
}
}
return FALSE;
}
- if (board->moves < 3)
+ if (board->moves < 3) {
board->cells[x][y].type = DVONN_CELL_RED;
- else if (board->moves % 2)
+ board->cells[x][y].contains_red = TRUE;
+ } else if (board->moves % 2) {
board->cells[x][y].type = DVONN_CELL_BLACK;
- else
+ } else {
board->cells[x][y].type = DVONN_CELL_WHITE;
+ }
board->cells[x][y].height = 1;
board->cells[x2][y2].height += board->cells[x1][y1].height;
board->cells[x2][y2].type = board->cells[x1][y1].type;
+ board->cells[x2][y2].contains_red |= board->cells[x1][y1].contains_red;
board->cells[x1][y1].type = DVONN_CELL_EMPTY;
board->cells[x1][y1].height = 0;
+ board->cells[x1][y1].contains_red = FALSE;
dvonn_board_next_player (board);