#Creating a random dice roller *generate a random number*

1 messages · Page 1 of 1 (latest)

novel finch
#

Hi everyone,

I'd like to ask if someone could help me out with generating a number from 0 - 100?

How would yall do it and what is the "best" way to do it ?

sage lichen
#

Random

fallen wyvern
#

*ThreadLocalRandom

novel finch
#

So it'd be java int randomNumber = ThreadLocalRandom.current().nextInt(0, 100);

sage lichen
#

ye

novel finch
#

Ohh okay, thanks alot!

sage lichen
#

you technically dont need a 0 there as the origin will start at 0, but it works either way

novel finch
#

I mean it's better to just put it at 0.