Connect 4 win checks!

So a Connect 4 board is 6 rows and 7 columns, I want horizontal, vertical, and diagonal win condition checks. So far I have horizontal wins checker.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
bool hwin(){
    for(int r=0; r<6; r++){
	for (int c=0; c<7;c++){	
	    if ((board [r][c] == 'X'||board [r][c] == 'O')&& 
		board[r][c] == board[r+1][c]&&
		board[r][c+1] == board[r+2][c]&&
		board[r][c+2] == board[r+3][c]&&
		board[r][c+3] == board[r+4][c]&&
		board[r][c+4] == board[r+5][c]&&
		board[r][c+5] == board[r+6][c]&&
		board[r][c+6] == board[r+7][c]&&
		)
		return true;
        }
		
    }
    return false;
}


How do I do diagonal and vertical?
Last edited on
why dont u help me instead
I would; however, in your post, http://www.cplusplus.com/forum/beginner/248912/ , the answer is provided.
Topic archived. No new replies allowed.