From abc0c766a81a2450bb3f055f40eea332c2a4785b Mon Sep 17 00:00:00 2001 From: fdai7729 Date: Mon, 5 Feb 2024 20:56:11 +0000 Subject: [PATCH] Update src/main/c/Template/Battleship_game.c --- src/main/c/Template/Battleship_game.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/main/c/Template/Battleship_game.c b/src/main/c/Template/Battleship_game.c index e9bf2e5..83bea8b 100644 --- a/src/main/c/Template/Battleship_game.c +++ b/src/main/c/Template/Battleship_game.c @@ -46,38 +46,50 @@ int multiplayer() { char ships1[100]; char ships2[100]; + char letco; + int numco, coor; + for (int i = 0; i <= 99; i++) { - multi[i] = 'X'; + multi[i] = '0'; } for (int i = 0; i <= 99; i++) { - player1[i] = 'X'; + player1[i] = '0'; } for (int i = 0; i <= 99; i++) { - player2[i] = 'X'; + player2[i] = '0'; } for (int i = 0; i <= 99; i++) { - ships1[i] = 'X'; + ships1[i] = '0'; } for (int i = 0; i <= 99; i++) { - ships2[i] = 'X'; + ships2[i] = '0'; } !feld(multi); + for (int i = 0; i <= 16; i++) { + + printf("Player 1, platziere deine Schiffe."); + scanf("%c%d", &letco, &numco); + + coor = convertcoor(letco, numco); + + ships1[coor] = 'X'; + return 0; }