mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2025-12-09 16:43:51 +00:00
33 lines
740 B
Plaintext
33 lines
740 B
Plaintext
/**
|
|
* Returns a list in plain english as a string.
|
|
*/
|
|
/proc/english_list(list/input, nothing_text = "nothing", and_text = " and ", comma_text = ", ", final_comma_text = "" )
|
|
var/total = input.len
|
|
if (!total)
|
|
return "[nothing_text]"
|
|
else if (total == 1)
|
|
return "[input[1]]"
|
|
else if (total == 2)
|
|
return "[input[1]][and_text][input[2]]"
|
|
else
|
|
var/output = ""
|
|
var/index = 1
|
|
while (index < total)
|
|
if (index == total - 1)
|
|
comma_text = final_comma_text
|
|
|
|
output += "[input[index]][comma_text]"
|
|
index++
|
|
|
|
return "[output][and_text][input[index]]"
|
|
|
|
/**
|
|
* Removes a string from a list.
|
|
*/
|
|
/proc/remove_strings_from_list(string, list/L)
|
|
if(!LAZYLEN(L) || !string)
|
|
return
|
|
while(string in L)
|
|
L -= string
|
|
return L
|