|
@ -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() { |
|
|