From e195415af470c1544ef34aba21d7876fec0700cb Mon Sep 17 00:00:00 2001 From: fdai7729 Date: Thu, 1 Feb 2024 23:59:02 +0000 Subject: [PATCH] Upload New File --- src/main/c/Template/Battleship_game.c | 60 +++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 src/main/c/Template/Battleship_game.c diff --git a/src/main/c/Template/Battleship_game.c b/src/main/c/Template/Battleship_game.c new file mode 100644 index 0000000..0bdf810 --- /dev/null +++ b/src/main/c/Template/Battleship_game.c @@ -0,0 +1,60 @@ +#include + +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; +} +