|
@ -32,8 +32,11 @@ char checkWinner() { |
|
|
if (verticalWinner != ' ') return verticalWinner; |
|
|
if (verticalWinner != ' ') return verticalWinner; |
|
|
} |
|
|
} |
|
|
// Überprüfe diagonale Linien |
|
|
// Überprüfe diagonale Linien |
|
|
if (board[0][0] == board[1][1] && board[1][1] == board[2][2]) return board[0][0]; |
|
|
|
|
|
else if (board[0][2] == board[1][1] && board[1][1] == board[2][0]) return board[0][2]; |
|
|
|
|
|
|
|
|
char diagonal1Winner = checkLine(board[0][0], board[1][1], board[2][2]); |
|
|
|
|
|
char diagonal2Winner = checkLine(board[0][2], board[1][1], board[2][0]); |
|
|
|
|
|
|
|
|
|
|
|
if (diagonal1Winner != ' ') return diagonal1Winner; |
|
|
|
|
|
if (diagonal2Winner != ' ') return diagonal2Winner; |
|
|
|
|
|
|
|
|
// Kein Gewinner |
|
|
// Kein Gewinner |
|
|
return ' '; |
|
|
return ' '; |
|
|