From 95c97636763ff420483d77a59bf813e4fac5b54d Mon Sep 17 00:00:00 2001 From: fdai7775 Date: Tue, 30 Jan 2024 12:00:33 +0000 Subject: [PATCH] Convert the number --- src/main/c/GameTic_Tac_Toe/game.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/c/GameTic_Tac_Toe/game.c b/src/main/c/GameTic_Tac_Toe/game.c index 089012b..48035ae 100644 --- a/src/main/c/GameTic_Tac_Toe/game.c +++ b/src/main/c/GameTic_Tac_Toe/game.c @@ -52,3 +52,7 @@ void makeMove() { printf("Spieler %c, wähle eine Zahl (1-9): ", currentPlayer); scanf("%d", &choice); +// Konvertiere die Zahl in Zeilen- und Spaltenindex + int row = (choice - 1) / 3; + int col = (choice - 1) % 3; +