Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re^3: Challenge: Mystery Word Puzzleby jdporter (Paladin) |
on Jan 13, 2005 at 22:55 UTC ( [id://422129]=note: print w/replies, xml ) | Need Help?? |
I fully concur with dragonchild that solving this problem requires either a dictionary containing all valid "words", or an ability to generate words. The latter would probably require having a machine that could answer the question "Is this a valid word?" for any given candidate. (This is sometimes called an "oracle".) An oracle could simply check for the existence of a word in a dictionary. This might lead to a better (i.e. more efficient) solution than a brute force search, if the dictionary is huge and well indexed for fast lookups. What would be really cool, though, would be an oracle that encodes all kinds of heuristics about what constitutes a valid English word. :-) I have written a script which determines the exact set of letters that a valid solution must contain, given a hint set. Actually, there could be more than one such sets. For example, given the hint set dealt - 2 in common solid - 2 in common rooky - 1 in common cedar - 1 in common edict - 0 in common flare - 3 in common shout - 1 in commonit produces the following list: afkls aflo aflsyThis means that any words which can be composed of exactly the set of letters 'a','f','k','l','s' (duplicates allowed) are solutions to the puzzle. And similarly for the other two letter sets. Of course, that still leaves the final, hardest, step: generating actual real words from the letters. Again, this could be brute-forced, but where's the fun in that? ;-) (Btw, my code also supports generation of puzzles — since you asked...)
In Section
Seekers of Perl Wisdom
|
|