From e937b3d8c3154c36d4a4fd92228813be3382e9fb Mon Sep 17 00:00:00 2001 From: KaffeeMaus Date: Fri, 26 Jan 2024 12:09:47 +0100 Subject: [PATCH] add the player won logic to the game handler --- src/main/c/Georg/tictactoe.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/c/Georg/tictactoe.c b/src/main/c/Georg/tictactoe.c index 45cb1e0..fcade80 100644 --- a/src/main/c/Georg/tictactoe.c +++ b/src/main/c/Georg/tictactoe.c @@ -191,6 +191,12 @@ void handleGame(){ free(params); printBoard(); + + if( playerHasWon( GAME.board ) ){ + printf("\n\nDu hast gewonnwn!\n\n"); + // start menu + GAME.currentState=0; + } } }