|Perl: the Markov chain saw|
literati cheat / finding words from scrambled lettersby sulfericacid (Deacon)
|on Nov 20, 2005 at 22:15 UTC||Need Help??|
sulfericacid has asked for the wisdom of the Perl Monks concerning the following question:
I want to create a literati cheat (yahoo game) that takes up to 7 characters (# as a wild) and makes ALL the different words it can from the letters.
Someone mentioned earlier I should use anagrams alaphbetically to decrease the search time. That is to say, I'd take the word "pear" and have it as "aepr" in my dictionary file followed by the real word on the same line.
My concern is this. With 7 or more characters, the possible letter combinations are in the thousands.. and then I have to check each combination to verify that it's a word. I'd like to do this using CGI but I fear I won't be able to get it fast enough where it won't time out.
Is map the best way of going about this? I am not too familiar with map and this ability. And I really don't understand the logic of how to use the anagrams or why it would be faster.
Thank you for all your help.
"Age is nothing more than an inaccurate number bestowed upon us at birth as just another means for others to judge and classify us"