diff --git a/src/main/c/TicTacToe.c b/src/main/c/TicTacToe.c index 035d6c4..14e960e 100644 --- a/src/main/c/TicTacToe.c +++ b/src/main/c/TicTacToe.c @@ -44,4 +44,13 @@ int Winner(char Feld[3][3]) { else return 2; } } + // Überprüfen Diagonalen + if ((Feld[0][0] == Feld[1][1] && Feld[1][1] == Feld[2][2]) || (Feld[0][2] == Feld[1][1] && Feld[1][1] == Feld[2][0])) { + if (Feld[1][1] != '_') { + if (Feld[1][1] == 'X') { + return 1; + } + else return 2; + } + } } \ No newline at end of file