Browse Source

13 win condition diagonal

remotes/origin/Simon
Simon Hildebrandt 11 months ago
parent
commit
47eadc8166
  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; 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