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; +} +