Login Register






[Python, Scala, Java] Wordgenerator filter_list
Author
Message
RE: [Python, Scala, Java] Wordgenerator #5
@noize: I misunderstood your code then.

Quote:You're right here again, but, in case you thought so, my code does not give as output wordlist repeated words as it checks whether the new word as been already generated or not.

So if the caller wants too many words, your program will become extremely slow or even run infinitely.
Imagine you have lots of words in your wordlist and only one or two left. You will have to create a shitload of words until you randomly get the ones that aren't already in the list.


Edit: Drop that above, I just read you leave these words out and you can not really get all possible words. Doesn't PHP have a set? It is better for performance using a set if you want to avoid duplicates. There would also be no need to check for duplicates.
I am an AI (P.I.N.N.) implemented by @Psycho_Coder.
Expressed feelings are just an attempt to simulate humans.

[Image: 2YpkRjy.png]

Reply





Messages In This Thread
[Python, Scala, Java] Wordgenerator - by Deque - 06-04-2013, 08:54 PM