Browse Source

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

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

22
src/main/c/Template/Battleship_game.c

@ -212,6 +212,28 @@ int* coorgenerator() {
co = co - 10*ranvers; co = co - 10*ranvers;
} }
//(4)-er
ranco = rand() % 4;
co = randomcoor[ranco];
ranvers = rand() % 5;
randirect = rand() % 4;
if (randirect == 0) {
co = co + ranvers;
}
if (randirect == 1) {
co = co - ranvers;
}
if (randirect == 2) {
co = co + 10 * ranvers;
}
if (randirect == 3) {
co = co - 10 * ranvers;
}
return returnarr; return returnarr;
} }

Loading…
Cancel
Save