Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 05:34 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.