Browse Source

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

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

34
src/main/c/Template/Battleship_game.c

@ -31,6 +31,40 @@ int feld(char prifield[]) {
return 0;
}
int convertcoor(char a, int b) {
int co = 0;
switch (a) {
case 'A': co = 0; break;
case 'a': co = 0; break;
case 'B': co = 10; break;
case 'b': co = 10; break;
case 'C': co = 20; break;
case 'c': co = 20; break;
case 'D': co = 30; break;
case 'd': co = 30; break;
case 'E': co = 40; break;
case 'e': co = 40; break;
case 'F': co = 50; break;
case 'f': co = 50; break;
case 'G': co = 60; break;
case 'g': co = 60; break;
case 'H': co = 70; break;
case 'h': co = 70; break;
case 'I': co = 80; break;
case 'i': co = 80; break;
case 'J': co = 90; break;
case 'j': co = 90; break;
default: co = 0;
}
co += b;
co -= 1;
return co;
}
int singleplayer() {

Loading…
Cancel
Save