Help! I’m trying to generate random numbers in two arrays and then merge them without the predefined function. Any suggestions would be great. Having issues converting between int [] and int…This is what i have so far:
void setup ()
{
int n = 5;
int m = 8;
int [] one = new int [n];
int [] two = new int [m];
foo(one,two);
one = sort(one);
two = sort(two);
printArray(one);
printArray(two);
}
int foo( int [] one, int [] two)
{
for(int i = 0; i < one.length; i ++)
{
for( int j = 0; j < two.length; j ++)
{
int r = (int(random(50)));
int [] random = {r};
one = random;
two = random;
return r;
}
}
}
Yes, thank you for the help. I’m confused involving generating random numbers in an array. I’m always getting convert errors. The goal is to merge two arrays that have random numbers and sort them without the predefined sort function. I should of been more clear.