Created
June 8, 2020 18:50
-
-
Save parzibyte/9169860fa24ef32f5e002706b7d01635 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
// Coloca una mina en las coordenadas indicadas | |
void colocarMina(int fila, int columna, char tablero[FILAS][COLUMNAS]) { | |
tablero[fila][columna] = MINA; | |
} | |
// Coloca minas de manera aleatoria. El número depende de CANTIDAD_MINAS | |
void colocarMinasAleatoriamente(char tablero[FILAS][COLUMNAS]) { | |
int l; | |
for (l = 0; l < CANTIDAD_MINAS; l++) { | |
int fila = aleatorioEnRango(0, FILAS - 1); | |
int columna = aleatorioEnRango(0, COLUMNAS - 1); | |
colocarMina(fila, columna, tablero); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment