HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Best way to sort Descending?

07-28-2008, 09:14 PM#1
TEC_Ghost
Ok so I've hit a snag, I need to sort some integers for an aggro board I've got going and I can't think of an easy way to get this done. So do any of you have any code certain ways of sorting an array of integers into ascending or descending order?

[edit] Damnit, I meant to put this is Trigger and Scripts.
07-28-2008, 10:06 PM#2
Here-b-Trollz
A doubly linked list could be helpful, and you would start at either the first or last link, depending on whether you want ascending or descending order.
07-28-2008, 10:23 PM#3
Captain Griffen
How many numbers? If very small, shuffle sort should be fine; otherwise quick sort will probably be quickest.
07-28-2008, 10:35 PM#4
TEC_Ghost
Anywhere from 1-15 numbers... So not to many, I need to grab them from an array, sort em and throw them into another array to display them on my multiboard.
07-28-2008, 10:50 PM#5
Captain Griffen
If you don't need totally optimal, shuffle sort'll be fine. Then again, suffle sort might be the most efficienct for such a small number.