I'm making a game in Java where I need dices. There are 3 dices for the attacker and 2 dices for the defencer. This is my code that randomize the eyes on all dices:
if (attacker.getArmies() > 1)
aDices[0] = random.nextInt(6) + 1;
if (attacker.getArmies() > 2)
aDices[1] = random.nextInt(6) + 1;
if (attacker.getArmies() > 3)
aDices[2] = random.nextInt(6) + 1;
if (defencer.getArmies() > 0)
dDices[0] = random.nextInt(6) + 1;
if (defencer.getArmies() > 1)
dDices[1] = random.nextInt(6) + 1;
But why are the numbers of the 'defence' dices mostly higher then the 'attack' dices?
I'm using the Random class from java.util.Random