I have this arrangement. The letters move only if the next position is a zero and my question is how can I check if the next position is a zero?
// Part of my code
System.out.println("¿A que numero desea moverla?");
int posicioni = menu.nextInt();
System.out.println("¿A que letra desea moverla?");
int posicionj = menu.nextInt();
b1 = posicioni;//Se le asigna a b1 la nueva posicion
b2 = posicionj;//Se le asigna a b2 la nueva posicion
for (i = 0; i < matriza.length; i++) {
for (j = 0; j < matriza.length; j++) {
System.out.print(matriza[i][j] + " ");
matriza[4][6] = "0";
matriza[b1][b2] = "r";
}
System.out.println("");
}
Mov++;//Contador para los movimientos
}