Browse Source

refactoring: Removing the currentPlayer global variable

remotes/origin/fdai7775-main-patch-54732
fdai7775 11 months ago
parent
commit
98533bbc98
  1. 2
      src/main/c/GameTic_Tac_Toe/game.c

2
src/main/c/GameTic_Tac_Toe/game.c

@ -60,7 +60,7 @@ int isBoardFull() {
// Funktion zum Zug eines Spielers
char switchPlayer(char currentPlayer) {
return (currentPlayer == 'X') ? 'O' : 'X';
return (currentPlayer == PLAYER_X) ? PLAYER_O : PLAYER_X;
}
int isValidMove(int choice) {

Loading…
Cancel
Save