This question already has an answer here:
How do I create a random integer ranging form -20 to 20 in java. I tried (int)(Math.random() * 20 - 20) but that only gives negatives. Thanks.
(int)(Math.random() * 20 - 20)
Aucun commentaire:
Enregistrer un commentaire