sort a list

Monkey Forums/Monkey Programming/sort a list

slenkar(Posted 2011) [#1]
how do you sort a list?

i want to do z-ordering so i want to sort people by their y coordinate


therevills(Posted 2011) [#2]
Ive managed to do it but by making my own list class, copying the monkey code and merging it with the BlitzMax list code... its not very generic and would be quite slow for Android...


Samah(Posted 2011) [#3]
This will have sorting very soon (once I get my arse in to gear and actually add it):

http://code.google.com/p/diddy/source/browse/#svn%2Ftrunk%2Fsrc%2Fdiddy%2Fcollections

Edit: Quicksort added to ArrayList. Go for it! ;)
By default it will only sort Ints and Floats automatically. You need to provide your own AbstractComparator class to tell it how to sort your own objects. The wrapper classes are incomplete at the moment, so you'll need to declare ArrayList<IntObject> etc.
I'll finish the wrappers and add string sorting soonish.