-
-
Save parzibyte/ab57d263a182a47cc09271b35cdbf0e4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void limpiar_bosque(char bosque[medidaGlobalBosque][medidaGlobalBosque]) { | |
for (int y = 0; y < medidaGlobalBosque; y++) { | |
for (int x = 0; x < medidaGlobalBosque; x++) { | |
bosque[y][x] = ESPACIO_VACIO; | |
} | |
} | |
} | |
void colocar_arboles_en_bosque(char bosque[medidaGlobalBosque][medidaGlobalBosque]) { | |
int contador = 0; | |
while (contador < medidaGlobalBosque) { | |
int x = aleatorio_en_rango(0, medidaGlobalBosque - 1); | |
int y = aleatorio_en_rango(0, medidaGlobalBosque - 1); | |
// Colocar árboles solo si no hay nada (en especial no debemos colocarlos en donde haya jugadores) | |
if (bosque[y][x] == ESPACIO_VACIO) { | |
bosque[y][x] = ARBOL; | |
contador++; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment