From a339d512a9838def58093393cceb81f0b5268818 Mon Sep 17 00:00:00 2001 From: fdai7729 Date: Fri, 9 Feb 2024 03:40:27 +0000 Subject: [PATCH] Update src/main/c/Template/Battleship_game.c --- src/main/c/Template/Battleship_game.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/c/Template/Battleship_game.c b/src/main/c/Template/Battleship_game.c index d71e93a..f44829d 100644 --- a/src/main/c/Template/Battleship_game.c +++ b/src/main/c/Template/Battleship_game.c @@ -265,7 +265,7 @@ int singleplayer() { while (higherscore < 17) { !feld(player); - printf("Runde %d\n\nScore: %d\n\nPlayer, gib eine Zielkoordinate ein: ", runde, score1); + printf("Runde %d\n\nDein Score: %d\n\nGegnerischer Score: %d\n\nPlayer, gib eine Zielkoordinate ein: ", runde, score1, score2); scanf(" %c%d", &letco, &numco); coor = convertcoor(letco, numco); @@ -282,6 +282,17 @@ int singleplayer() { printf("Kein Treffer.\n\n"); } + coor = hitgenerator(); + + int f = 0; + + while (f != 1) { + + if (progplayer[coor] == '0') { + f = 1; + } + } + if (score1 >= score2) { higherscore = score1; }