Browse Source

13 win condition diagonal

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

9
src/main/c/TicTacToe.c

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