In response to Killerdragon
mob
var/list
strings=list()
verb
stuff()
usr.name=pick("John","Paul","Terry","Steve")+" "+pick("Smith","Anderson","Stevenson","Bower")
usr.stuff2(name)
proc
stuff2(var/string)
if(strings.Find(string))
if(strings.len==16)
src<<"No more possiblities."
else
src.stuff()
else
strings.Add(string)
src<<string


You're calling stuff() like a procedure without setting usr - in this case it should never happen that stuff2 is started without stuff being called, but you shouldn't assume that.

Secondly, you've expanded the scope of the strings var well beyond what it should be. It should be a local variable, not a mob variable.

Thirdly, you're checking for a specific length to terminate the procedure at. That means it'll only ever work for cases where there are sixteen different combinations.

Fourthly, the use of pick() means that you could conceivably loop forever if you got (un)lucky.

Finally, it's slow. O(N**3), assuming the pick()s get a new combination every time. And that assumption makes it faster.
In response to Jp
Okay, so parts 1-3 I know how to fix. I am confused on the pick portion however. I understand what you are saying, but what would you recommend to fix that? Unless of course...

Well couldn't you still use pick, but instead search for the individual phrases in the first list of names in the strings var, then weed them out from the pick() to make it faster?
In response to Killerdragon
Assuming you're only combining two lists:

for(var/a in l1)
for(var/b in l2)
combinations+=a+b

Page: 1 2