From 7f8de3f06bb9fa26aca2ef129c4b6041b24dc4f1 Mon Sep 17 00:00:00 2001 From: Ariana Ginju Date: Tue, 30 Jan 2024 11:58:28 +0000 Subject: [PATCH] Verification function --- src/main/c/GameTic_Tac_Toe/game.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/c/GameTic_Tac_Toe/game.c b/src/main/c/GameTic_Tac_Toe/game.c index a91ba51..6432f7f 100644 --- a/src/main/c/GameTic_Tac_Toe/game.c +++ b/src/main/c/GameTic_Tac_Toe/game.c @@ -32,3 +32,15 @@ char checkWinner() { // Kein Gewinner return ' '; } + +// Funktion zur Überprüfung, ob das Spiel unentschieden ist +int isBoardFull() { + for (int i = 0; i < 3; i++) { + for (int j = 0; j < 3; j++) { + if (board[i][j] != 'X' && board[i][j] != 'O') { + return 0; + } + } + } + return 1; +}