public int intRet1;
public int intRet2;
public void IntRandom(int intNumber)
{
int intNum[] = new int[36];
Random randomGen = new Random();
intNum[0] = randomGen.nextInt(intNumber)+1;
do{
intNum[1] = randomGen.nextInt(intNumber)+1;
}while(intNum[0] == intNum[1]);
intRet1 = intNum[0];
intRet2 = intNum[1];
}
today I tried using java.util.Random class, but as you can see I have 36 arrayElement and each element is unique from the rest(note, intNumber has a corresponding value 42, 45, 49, 55; depends on which button I press) what I'm thinking is I can just write the rest of the code by repeating the do while() statement, change the indexExponent and the while statement like this:
do{
intNum[1] = randomGen.nextInt(intNumber)+1;
}while(intNum[0] == intNum[1]);
do{
intNum[2] = randomGen.nextInt(intNumber)+1;
}while(intNum[0] == intNum[2] && intNum[1] == intNum[2]);
But I think my code would be too long. Is there another way that I can write this shorter?