Browse Source

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

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

19
src/main/c/Template/Battleship_game.c

@ -226,7 +226,26 @@ int singleplayer() {
!feld(ships1); !feld(ships1);
while (score1 || score2 < 16) {
!feld(player);
printf("Player 1, gib eine Zielkoordinate ein: ");
scanf(" %c%d", &letco, &numco);
coor = convertcoor(letco, numco);
if (ships2[coor] == 'X') {
player[coor] = 'X';
score1 += 1;
printf("Treffer!!\n");
}
else {
player[coor] = '-';
printf("Kein Treffer.\n");
}
}
return 0;
} }
int multiplayer() { int multiplayer() {

Loading…
Cancel
Save