Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created June 8, 2020 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/9169860fa24ef32f5e002706b7d01635 to your computer and use it in GitHub Desktop.
Save parzibyte/9169860fa24ef32f5e002706b7d01635 to your computer and use it in GitHub Desktop.
// 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