Browse Source

Update src/main/c/Template/Battleship_game.c

remotes/origin/Battleship_game
fdai7729 11 months ago
parent
commit
abc0c766a8
  1. 22
      src/main/c/Template/Battleship_game.c

22
src/main/c/Template/Battleship_game.c

@ -46,38 +46,50 @@ int multiplayer() {
char ships1[100]; char ships1[100];
char ships2[100]; char ships2[100];
char letco;
int numco, coor;
for (int i = 0; i <= 99; i++) { for (int i = 0; i <= 99; i++) {
multi[i] = 'X';
multi[i] = '0';
} }
for (int i = 0; i <= 99; i++) { for (int i = 0; i <= 99; i++) {
player1[i] = 'X';
player1[i] = '0';
} }
for (int i = 0; i <= 99; i++) { for (int i = 0; i <= 99; i++) {
player2[i] = 'X';
player2[i] = '0';
} }
for (int i = 0; i <= 99; i++) { for (int i = 0; i <= 99; i++) {
ships1[i] = 'X';
ships1[i] = '0';
} }
for (int i = 0; i <= 99; i++) { for (int i = 0; i <= 99; i++) {
ships2[i] = 'X';
ships2[i] = '0';
} }
!feld(multi); !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; return 0;
} }

Loading…
Cancel
Save