From c81a0771c8ae5c8f4220b248f7fc3d4a116a288c Mon Sep 17 00:00:00 2001 From: Sabina Grisi Date: Fri, 9 Feb 2024 21:54:53 +0100 Subject: [PATCH] Pruefung auf Gewinn fuer Position 1, 4, 7 --- src/TicTacToe.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/TicTacToe.c b/src/TicTacToe.c index ed4159c..a1e0514 100644 --- a/src/TicTacToe.c +++ b/src/TicTacToe.c @@ -81,6 +81,14 @@ int main() { printf("\nSpieler O hat gewonnen!\n\n"); break; } + } else if (pos1 == player && pos4 == 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);