24 lines
482 B
Plaintext
24 lines
482 B
Plaintext
fn separate words: =
|
|
(
|
|
if words == unsupplied or words == undefined or classof words != array then return "{}"
|
|
else
|
|
(
|
|
local toReturn = "{"
|
|
local pos = 1
|
|
while pos <= words.count do
|
|
(
|
|
if pos == 1 then (append toReturn words[pos]; pos+=1)
|
|
else
|
|
(
|
|
if pos <= words.count-1 then (append toReturn (", "+words[pos]); pos+=1)
|
|
else
|
|
(
|
|
append toReturn (" and " + words[pos])
|
|
pos +=1
|
|
)
|
|
)
|
|
)
|
|
return (toReturn+"}")
|
|
)
|
|
)
|