maquina += numeroale.nextInt(4);
maquina += numeroale.nextInt(4);
//vez da mqauina
for (int i = 0; i < maquina.length(); i++) {
System.out.println("valor atual"+maquina.substring(i,1));
if((maquina.substring(i,1)).equals("0")){
System.out.println("0 pressed");
b1.setBackground(Color.white);
play("b1");
}
else if((maquina.substring(i,1)).equals("1")){
System.out.println("1 pressed");
b2.setBackground(Color.white);
play("b2");
}
else if((maquina.substring(i,1)).equals("2")){
System.out.println("2 pressed");
b3.setBackground(Color.white);
play("b3");
} else if((maquina.substring(i,1)).equals("3")){
System.out.println("3 pressed");
b4.setBackground(Color.white);
play("b4");
}
else{
}
}
The code can not compare to the second position, but the first one goes after the error