From 241281f9906a3aafc694945ee1f9d3f86c2a23a9 Mon Sep 17 00:00:00 2001 From: Sabina Grisi Date: Fri, 9 Feb 2024 22:00:28 +0100 Subject: [PATCH] Pruefung auf Gewinn fuer Position 3, 5, 7 --- src/TicTacToe.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/TicTacToe.c b/src/TicTacToe.c index 6c61721..b25926e 100644 --- a/src/TicTacToe.c +++ b/src/TicTacToe.c @@ -113,6 +113,14 @@ int main() { printf("\nSpieler O hat gewonnen!\n\n"); break; } + } else if (pos3 == player && pos5 == player && pos7 == player) { + if(player == 10){ + printf("\nSpieler X hat gewonnen!\n\n"); + break; + }else{ + printf("\nSpieler O hat gewonnen!\n\n"); + break; + } } player = switchPlayer(player);