I need it so that the Dice has 6 sides, and when I make something to roll it, the dice would land on either 1-66? I'm not exactly sure what your asking. If your seeing sides, 6 would be fine since it has 6 sides.
I do think that is what I was looking forint i = 0;
Random rand = new Random();
i = rand.nextInt(5) + 1;
=====
I dont know if that's what your looking for, but what it does is sets int i to a random integer from 0-5
Thanks, going to try and test it out!Set it to 6 and then in the random do nextInt(dice1)+1
Nice but this would also work (it's only one line):int i = 0;
Random rand = new Random();
i = rand.nextInt(5) + 1;
=====
I dont know if that's what your looking for, but what it does is sets int i to a random integer from 0-5
int diceRoll = new Random().nextInt(6) + 1;
tmw> you read it wrong...That will do 1-5, 0-5 would be without the +1 and 1-6 would be nextInt(6)+1
You sure? I'm no Java mastermind but wouldn't 5 be the Max value?That will do 1-5
Nah, he wants a dice that rolls 1 - 6. To get that, he is correct by doing +1 at the end since it will increment each by 1 making 5 into 6 and 0 into 1 etc.You sure? I'm no Java mastermind but wouldn't 5 be the Max value?
Ahh, sorry misread. The quote isn't fully posted and so I was confusedYeah, I know that. Please read the OP post I quoted.
Let's just all agree that we're bad at reading stuff properly. As I just discovered.How did I read it wrong? You said it will do 0-5
Agreed.Let's just all agree that we're bad at reading stuff properly. As I just discovered.
