Browse Source

Check horizontal and vertical lines

remotes/origin/fdai7775-main-patch-54732
fdai7775 11 months ago
parent
commit
2d7b1b0e8c
  1. 5
      src/main/c/GameTic_Tac_Toe/game.c

5
src/main/c/GameTic_Tac_Toe/game.c

@ -20,3 +20,8 @@ void displayBoard() {
// Funktion zur Überprüfung des Gewinners
char checkWinner() {
// Überprüfe horizontale und vertikale Linien
for (int i = 0; i < 3; i++) {
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];
}
Loading…
Cancel
Save