row_has_no_threes_of_color

PHOTO EMBED

Mon Oct 17 2022 14:55:23 GMT+0000 (Coordinated Universal Time)

Saved by @zaczhuang

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