mercredi 2 juin 2021

How could I get a random number from 1 to 8 using Math.random()? [duplicate]

I tried using (int) Math.random() * 8 + 1; to get a random number in that range and turn it to an int, but I just keep getting 1. What could I do to make this work?




Aucun commentaire:

Enregistrer un commentaire