From 0d188261b2ad94bb5efa2a48e553496662ef42b1 Mon Sep 17 00:00:00 2001 From: Ariana Ginju Date: Tue, 30 Jan 2024 17:56:28 +0000 Subject: [PATCH] refactoring: using const --- src/main/c/GameTic_Tac_Toe/game.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/c/GameTic_Tac_Toe/game.c b/src/main/c/GameTic_Tac_Toe/game.c index f193efa..f20e298 100644 --- a/src/main/c/GameTic_Tac_Toe/game.c +++ b/src/main/c/GameTic_Tac_Toe/game.c @@ -43,9 +43,11 @@ char checkWinner() { } // Funktion zur Überprüfung, ob das Spiel unentschieden ist +const int BOARD_SIZE = 3; + int isBoardFull() { - for (int i = 0; i < 3; i++) { - for (int j = 0; j < 3; j++) { + for (int i = 0; i < BOARD_SIZE; i++) { + for (int j = 0; j < BOARD_SIZE; j++) { if (board[i][j] != 'X' && board[i][j] != 'O') { return 0; }