Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created May 21, 2021 18:36
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/ff49dfe04eac3044184dde5433edc673 to your computer and use it in GitHub Desktop.
Save parzibyte/ff49dfe04eac3044184dde5433edc673 to your computer and use it in GitHub Desktop.
// Devuelve coordenadas válidas
static int[] obtenerCoordenadasAleatorias(char jugador, char[][] tableroOriginal) {
int x, y;
do {
x = aleatorioEnRango(0, COLUMNAS - 1);
y = aleatorioEnRango(0, FILAS - 1);
} while (!coordenadasVacias(y, x, tableroOriginal));
return new int[]{x, y};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment