|
@ -75,6 +75,67 @@ int feld(char prifield[]) { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
shipcoor[0] = co; |
|
|
|
|
|
|
|
|
|
|
|
int shipdirect = rand() % 2; |
|
|
|
|
|
|
|
|
|
|
|
if (a == 1) { |
|
|
|
|
|
if (shipdirect == 0) { |
|
|
|
|
|
for (int i = 1; i < 5; i++) { |
|
|
|
|
|
co -= 1; |
|
|
|
|
|
shipcoor[i] = co; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (shipdirect == 1) { |
|
|
|
|
|
for (int i = 1; i < 5; i++) { |
|
|
|
|
|
co -= 10; |
|
|
|
|
|
shipcoor[i] = co; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (a == 2) { |
|
|
|
|
|
if (shipdirect == 0) { |
|
|
|
|
|
for (int i = 1; i < 5; i++) { |
|
|
|
|
|
co -= 1; |
|
|
|
|
|
shipcoor[i] = co; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (shipdirect == 1) { |
|
|
|
|
|
for (int i = 1; i < 5; i++) { |
|
|
|
|
|
co += 10; |
|
|
|
|
|
shipcoor[i] = co; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (a == 3) { |
|
|
|
|
|
if (shipdirect == 0) { |
|
|
|
|
|
for (int i = 1; i < 5; i++) { |
|
|
|
|
|
co += 1; |
|
|
|
|
|
shipcoor[i] = co; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (shipdirect == 1) { |
|
|
|
|
|
for (int i = 1; i < 5; i++) { |
|
|
|
|
|
co -= 10; |
|
|
|
|
|
shipcoor[i] = co; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (a == 4) { |
|
|
|
|
|
if (shipdirect == 0) { |
|
|
|
|
|
for (int i = 1; i < 5; i++) { |
|
|
|
|
|
co += 1; |
|
|
|
|
|
shipcoor[i] = co; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (shipdirect == 1) { |
|
|
|
|
|
for (int i = 1; i < 5; i++) { |
|
|
|
|
|
co += 10; |
|
|
|
|
|
shipcoor[i] = co; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return 0; |
|
|
return 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|