Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
carmolim
carmolim's Profile
2
Posts
4
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
sorting question...
[1 Reply]
14-Sep-2010 03:55 PM
Forum:
Programming Questions
Hi...
Imagine something like that:
int[] n = new int [4];
String[] names = { "Augusto","Christofer","Erick","Victor",
};
for (int i = 0; i < n.length; i++){
n[i] = int(random(2,10));
print(n[i]+", ");
}
ok, now I need to sort the array n[], and I want that the order of the array names[] match the same order of the array n[]
for exemple:
n[0] = 5; names[0] = "Augusto";
n[1] = 3; names[1] = "
Christofer";
n[2] = 7; names[2] = "Erick";
n[3] = 9; names[3] = "Victor";
after sorting the array n[]
n[0] = 3; names[0] = "Christofer";
n[1] = 5; names[1] = "Augusto";
n[2] = 7; names[2] = "Erick";
n[3] = 9; names[3] = "Victor";
There is a
n easy way to do this?
Thanks
create new array inside loop?
[10 Replies]
09-Sep-2010 01:20 PM
Forum:
Programming Questions
hey guys
I need some advice, I am in a for loop, and I need to create a new unique Array each time the loop goes thru... Any ideas?
for(i=0;i<thumblength;i++){
//need to create an array with i variable in the path here...
}
«Prev
Next »
Moderate user : carmolim
Forum