diff --git a/src/main/c/GameTic_Tac_Toe/game.c b/src/main/c/GameTic_Tac_Toe/game.c index a08e501..3f1dc5a 100644 --- a/src/main/c/GameTic_Tac_Toe/game.c +++ b/src/main/c/GameTic_Tac_Toe/game.c @@ -25,3 +25,7 @@ char checkWinner() { if (board[i][0] == board[i][1] && board[i][1] == board[i][2]) return board[i][0]; if (board[0][i] == board[1][i] && board[1][i] == board[2][i]) return board[0][i]; } + // Überprüfe diagonale Linien + if (board[0][0] == board[1][1] && board[1][1] == board[2][2]) return board[0][0]; + if (board[0][2] == board[1][1] && board[1][1] == board[2][0]) return board[0][2]; +