From 36d75c111cbcc1a583de5762d5d8ef4b44f708c1 Mon Sep 17 00:00:00 2001 From: fdai7775 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; }