Browse Source

Upload New File

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

60
src/main/c/Template/Battleship_game.c

@ -0,0 +1,60 @@
#include <stdio.h>
int feld(char prifield[]) {
int a = 0;
for (int i = 0; i <= 9; i++) {
for (int j = 0; j <= 9; j++) {
printf("%c", prifield[a]);
a++;
}
printf("\n");
}
return 0;
}
int singleplayer() {
}
int multiplayer() {
char multi[100];
for (int i = 0; i <= 99; i++) {
multi[i] = 'X';
}
!feld(multi);
return 0;
}
int main() {
int player;
printf("*Battleship*\n\n Single player: press <1>\n Multiplayer: press <2>\n");
scanf("%d", &player);
if (player == 1) {
!singleplayer();
}
else if (player == 2) {
!multiplayer();
}
return 0;
}
Loading…
Cancel
Save