Im trying to make a random number generator for 8 shapes,and im have a little trouble at da moment with my coding.
so far my function looks like this:
public void random(){
for(int i =1;i <8; i++){
int n1 = (int) (Math.Random() * number);
int n2 = (int) (Math.Random() * number);
Shape temp = stack[n1];
stack[n1] = stack[n2];
stack[n2] = temp;
}
}
}
it wont seem to compile,so do i have to declare my n1 variables ? and also stack? IF i want to call the random function,how do i call it?
so far my function looks like this:
public void random(){
for(int i =1;i <8; i++){
int n1 = (int) (Math.Random() * number);
int n2 = (int) (Math.Random() * number);
Shape temp = stack[n1];
stack[n1] = stack[n2];
stack[n2] = temp;
}
}
}
it wont seem to compile,so do i have to declare my n1 variables ? and also stack? IF i want to call the random function,how do i call it?