Browse Source

4 win condition row

remotes/origin/Simon
Simon Hildebrandt 11 months ago
parent
commit
4af9a27662
  1. 12
      src/main/c/TicTacToe.c

12
src/main/c/TicTacToe.c

@ -24,3 +24,15 @@ void Bild(char Feld[3][3]) {
printf("\n"); printf("\n");
} }
} }
int Entscheiden(char Feld[3][3]) {
// Überprüfen Sieg
// Überprüfen Reihen
for (int i = 0; i < 3; i++) {
if (Feld[i][0] == Feld[i][1] && Feld[i][1] == Feld[i][2] && Feld[i][0] != '_') {
if (Feld[i][0] == 'X') {
return 1;
}
else return 2;
}
}
}
Loading…
Cancel
Save