As the title says I'm trying to get my code to not generate the same number twice in a set array. EX: (comp is an array defined as int[] comp = new int[20];)
Random ran = new Random();
for(int i = 0; i < comp.length; i++)
{
comp[i] = ran.nextInt(80)+1;
for(int j = 0; j < comp.length; j++)
{
if(comp[i] == comp[j])
comp[i] = ran.nextInt(80)+1;
}
System.out.println(comp[i]);
}