row_has_no_threes_of_color

PHOTO EMBED

Sun Oct 16 2022 21:50:52 GMT+0000 (Coordinated Universal Time)

Saved by @willzhao

bool row_has_no_threes_of_color(const int board[MAX_SIZE][MAX_SIZE],
                                int size,
                                int row,
                                int color) {
    // write your code here
    for (int i = 0; i < size; i++) {
        if (board[row][i] == color &&
            board[row][i + 1] == color &&
            board[row][i + 2] == color) {
            return 0;
        }
            else {
                return 1;
            }
    }
}
content_copyCOPY