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