SAE partie 2
This commit is contained in:
parent
4019c6178c
commit
9feb9b4361
@ -6,9 +6,9 @@
|
||||
void ajoutNavireAleatoire(char tab[][10], char b, int t) {
|
||||
int direction = rand() % 2; // 0 for horizontal, 1 for vertical
|
||||
int x, y;
|
||||
int valid = 0;
|
||||
int place = 0;
|
||||
|
||||
while (!valid) {
|
||||
while (!place) {
|
||||
if (direction == 0) { // Horizontal
|
||||
x = rand() % (10 - t + 1);
|
||||
y = rand() % 10;
|
||||
|
Loading…
x
Reference in New Issue
Block a user