Anyways, as I was reading through the DM guide I realized you can past lists into min() and max() (I never knew this, I always thought it only took two arguments)
So yeah, here's a really simple sorting snippet:
var/list/List=list()
var/list/orderedList=list()
for(var/i=1 to 10)
List+=rand(1,100)
for(var/i=1 to List.len)
var/item = max(List)
orderedList+=item
List-=item
world<<item
I'm sure this probably isn't news to most, but I know turn-based RPG's tend to be a favorite amongst the developers I've talked to, and perhaps this'll help out any newbies.
I sure wish I would've known about it considering the countless number of times I struggled with simple numerical sorting.
Cheers
If you're not familiar with sorting algorithms here's a page that lists them with their complexity:
https://en.wikipedia.org/wiki/Sorting_algorithm
I'd probably advise merge sort as being better:
https://en.wikipedia.org/wiki/Merge_sort
It's reasonably easy to do in BYOND and the code is quite translatable.