From 2c917dcf38acf6a99b08e58a4707a3719002d1cc Mon Sep 17 00:00:00 2001 From: Sabina Grisi Date: Fri, 9 Feb 2024 21:59:26 +0100 Subject: [PATCH] Pruefung auf Gewinn fuer Position 1, 5, 9 --- src/TicTacToe.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/TicTacToe.c b/src/TicTacToe.c index 6c4f741..6c61721 100644 --- a/src/TicTacToe.c +++ b/src/TicTacToe.c @@ -105,6 +105,14 @@ int main() { printf("\nSpieler O hat gewonnen!\n\n"); break; } + } else if (pos1 == player && pos5 == player && pos9 == player) { + if(player == 10){ + printf("\nSpieler X hat gewonnen!\n\n"); + break; + }else{ + printf("\nSpieler O hat gewonnen!\n\n"); + break; + } } player = switchPlayer(player);