ID:170129
 
Okay, I have a list.

            var/list/wee=list("")
for(var/obj/Choose_Character/x in world)
wee+=x
wee+="Cancel"


Hm, well my question is there a way I can put the list in alphabetical order that isn't too hard to do?
var/FirstLetter = text2ascii(ckey(src.Name),1)


That would be a start. Of course you'd need to match each person from the old list with each person from the old list to see if they are higher number.

var/list/NewList=new //The new player list
var/Winner = "" //Winner of the two in question
for(var/Lacky in Players) //testie
for(var/I=1,I<=length(Players),I++) //start loop of numrods...
var/Nimrod = Players[I] //Set Nimrod
if(!Nimrod || !Lacky) break //Uh oh...someone isn't there...
var A,B
do //start loop
var/Track = 0 //define the variable used for increments...
Track++ //Increment
A = text2ascii(ckey(Lacky),Track) //Check the letters
B = text2ascii(ckey(Nimrod),Track) //Check the letters
if(A!=B) //Finish off the crap
if(A>B) //The lacky goes first!
Winner = Lacky
else //Nimrod goes first!
Winner = Nimrod
while(A==B) //Do while A is equal to be
NewList+=Winner //Add the winner to the new list
Players-=Winner //Remove the winner
Winner = "" //Clear Winner Variable
Players=NewList //Make Players ABC order


Well, that's a sample thingy -.-'

I didn't double check or anything. So don't copy and paste...just get an idea or two.

-Ryan