Browse Source

4 win condition row

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

12
src/main/c/TicTacToe.c

@ -23,4 +23,16 @@ 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