Browse Source

Check whether the selected field is valid

remotes/origin/Ariana
Ariana Ginju 11 months ago
committed by David Moeller
parent
commit
f1b61336a5
  1. 4
      src/main/c/GameTic_Tac_Toe/game.c

4
src/main/c/GameTic_Tac_Toe/game.c

@ -56,3 +56,7 @@ void makeMove() {
int row = (choice - 1) / 3;
int col = (choice - 1) % 3;
// Überprüfe, ob das gewählte Feld gültig ist
if (choice >= 1 && choice <= 9 && board[row][col] != 'X' && board[row][col] != 'O') {
Loading…
Cancel
Save