Skip to content

Instantly share code, notes, and snippets.

@kurotori
Created August 18, 2024 23:22
Show Gist options
  • Save kurotori/c3576a850673f5fd758afee6b8a6e5ab to your computer and use it in GitHub Desktop.
Save kurotori/c3576a850673f5fd758afee6b8a6e5ab to your computer and use it in GitHub Desktop.
Programación 1 BP - Ejemplos de Java
static void barajar(int[][] baraja){
Random azar = new Random();
int[] carta1 = {};
int[] carta2 = {};
for (int i = 0; i < baraja.length; i++) {
int posicion = azar.nextInt(baraja.length);
carta1 = baraja[i];
baraja[i] = baraja[posicion];
baraja[posicion] = carta1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment