Thread: Sorting array
View Single Post
  #1  
Old 02-05-2007, 11:49 PM
Twizt3d Twizt3d is offline
Registered User
Join Date: Jul 2003
Posts: 15
Twizt3d is on a distinguished road
Sorting array

I am adding values from one array into another array. How would I sort the second array by the index numbers of the first.

example:
PHP Code:
this.firstarray = {1,2,3,4,5,6,7,8,9,10,11,12,13};

for (
temp.0temp.i<7temp.i++){
   
temp.random int(random(0,13));
   
this.secondarray.add(this.firstarray[temp.random]);
   
//some algorthm to sort the second array by the index's of the first array

Does this make any sense?
Reply With Quote