Browse Source

Pruefung auf Gewinn fuer Position 1, 4, 7

remotes/origin/tictactoedev
Sabina Grisi 11 months ago
parent
commit
c81a0771c8
  1. 8
      src/TicTacToe.c

8
src/TicTacToe.c

@ -81,6 +81,14 @@ int main() {
printf("\nSpieler O hat gewonnen!\n\n"); printf("\nSpieler O hat gewonnen!\n\n");
break; break;
} }
} else if (pos1 == player && pos4 == player && pos7 == player) {
if(player == 10){
printf("\nSpieler X hat gewonnen!\n\n");
break;
}else{
printf("\nSpieler O hat gewonnen!\n\n");
break;
}
} }
player = switchPlayer(player); player = switchPlayer(player);

Loading…
Cancel
Save