I have tried to program a random number generator that is not repetitive. But I am unable to and can't figure out why. My code is like this at the moment :
public void printNS(){
System.out.print("Numeros Numeros: ");
for(int i=0; i < 5 ; i++){
System.out.print( (int)(Math.random()*50) + ",");
}
System.out.print("; Numeros Stars: ");
for(int i=0; i < 2 ; i++){
System.out.print( (int)(Math.random()*12)+ ",");
}
}
Aucun commentaire:
Enregistrer un commentaire