SCREEE. fuck this. I'mma just revert at this point, but don't want to lose progress.

This commit is contained in:
Poojawa
2018-03-19 04:57:57 -05:00
parent d387481aa5
commit a2fbab5ccb
24 changed files with 939 additions and 742 deletions
+23 -1
View File
@@ -24,4 +24,26 @@ GLOBAL_LIST_EMPTY(whitelisted_species_list)
/proc/log_mentor(text)
GLOB.mentorlog.Add(text)
GLOB.world_game_log << "\[[time_stamp()]]MENTOR: [text]"
GLOB.world_game_log << "\[[time_stamp()]]MENTOR: [text]"
//Mergesort: any value in a list, preserves key=value structure
/proc/sortAssoc(var/list/L)
if(L.len < 2)
return L
var/middle = L.len / 2 + 1 // Copy is first,second-1
return mergeAssoc(sortAssoc(L.Copy(0,middle)), sortAssoc(L.Copy(middle))) //second parameter null = to end of list
/proc/mergeAssoc(var/list/L, var/list/R)
var/Li=1
var/Ri=1
var/list/result = new()
while(Li <= L.len && Ri <= R.len)
if(sorttext(L[Li], R[Ri]) < 1)
result += R&R[Ri++]
else
result += L&L[Li++]
if(Li <= L.len)
return (result + L.Copy(Li, 0))
return (result + R.Copy(Ri, 0))