From 2e4466f89c01a034653230bf7d252502e0322f56 Mon Sep 17 00:00:00 2001 From: Simon Hildebrandt Date: Wed, 7 Feb 2024 17:22:16 +0100 Subject: [PATCH] 22 belegtes Feld O --- src/main/c/TicTacToe.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/c/TicTacToe.c b/src/main/c/TicTacToe.c index d46d3b3..17f75bb 100644 --- a/src/main/c/TicTacToe.c +++ b/src/main/c/TicTacToe.c @@ -71,6 +71,14 @@ void Zuege(char Feld[3][3], int row, int col) { if (Feld[row][col] == '_') { Feld[row][col] = 'O'; } + else { + printf("Das Feld ist schon besetzt. Gib ein anderes Feld ein:\n"); + printf("[Reihe Spalte]:"); + scanf("%d %d"); + row -= 1; + col -= 1; + Zuege(Feld, row, col); + } } else { if (Feld[row][col] == '_') {