So i need to return multiple arrays from a function in process. The problem is i don't know which function value to use? (eg int function, string function etc) Also, how do i return multiple values? I need the send barrierx and barriery from arrayGen() to barriers(). Thanks for your help!
Final:
int barriers(){
if (R == 1){
while (size>0){
barrierx[size-1] = randomInt(512);
barriery[size-1] = randomInt(512);
size = size - 1;
}
while (sizeC>0){
ellipse( barrierx[sizeC-1], barriery[sizeC-1], 100, 100);
sizeC = sizeC - 1;
}
sizeC = sizeB;
R = 0;
}
return 5;
}
int arrayGen(){
int size = randomInt(11);
int sizeB = size;
int sizeC = size;
int[] barrierx = new int[size];
int[] barriery = new int[size];
}
EDIT:
int arrayGen(){
int size = randomInt(11);
int sizeB = size;
int sizeC = size;
int[] result = new int[2];
int[] barrierx = new int[size];
int[] barriery = new int[size];
while (size>0){
barrierx[size-1] = randomInt(512);
barriery[size-1] = randomInt(512);
size = size - 1;
}
result[0] = barrierx;
result[1] = barriery;
return result;
}
type mismatch cannot convert from int[] to int
int[][]( array of arrays )List