Browse Source

9 win condition column

main^2
Simon Hildebrandt 11 months ago
committed by Peter Wiebe
parent
commit
5f7c1d755b
  1. 9
      src/main/c/TicTacToe.c

9
src/main/c/TicTacToe.c

@ -35,4 +35,13 @@ int Winner(char Feld[3][3]) {
else return 2;
}
}
// Überprüfen Spalten
for (int j = 0; j < 3; j++) {
if (Feld[0][j] == Feld[1][j] && Feld[1][j] == Feld[2][j] && Feld[0][j] != '_') {
if (Feld[0][j] == 'X') {
return 1;
}
else return 2;
}
}
}
Loading…
Cancel
Save