From fd7e417730347ebb7b797ee8e6e49398a60904fa Mon Sep 17 00:00:00 2001 From: fdai7729 Date: Fri, 9 Feb 2024 03:53:43 +0000 Subject: [PATCH] Update src/main/c/Template/Battleship_game.c --- src/main/c/Template/Battleship_game.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/c/Template/Battleship_game.c b/src/main/c/Template/Battleship_game.c index 1999e97..7bb546b 100644 --- a/src/main/c/Template/Battleship_game.c +++ b/src/main/c/Template/Battleship_game.c @@ -728,9 +728,10 @@ int singleplayer() { char progplayer[100]; char ships1[100]; char ships2[100]; + int* gencoor = coorgenerator(); char letco; - int numco; + int numco, ranco; int coor, coor1, coor2; int score1 = 0; int score2 = 0; @@ -760,6 +761,11 @@ int singleplayer() { } + for (int i = 0; i <= 18; i++) { + ranco = gencoor[i]; + ships2[ranco] = 'X'; + } + !feld(ships1); printf("\nPlayer, platziere dein Schlachtschiff (5).\nKoordinate: ");