Browse Source

Funktion Anzahl der Felder

remotes/origin/homan
fdai7892 11 months ago
parent
commit
569d456751
  1. 12
      src/main/duellist-spielesammlung-projekt.c

12
src/main/duellist-spielesammlung-projekt.c

@ -46,7 +46,17 @@ Player getCurrentPlayer(const TicTacToeGame * game) {
return game->currentPlayer; return game->currentPlayer;
} }
int getNumberOfMoves(const TicTacToeGame* game) {
int moves = 0;
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < 3; ++j) {
if (game->board[i][j] != EMPTY) {
moves++;
}
}
}
return moves;
}

Loading…
Cancel
Save