Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Challenge: Mystery Word Puzzle

by CountZero (Bishop)
on Jan 12, 2005 at 20:12 UTC ( [id://421742]=note: print w/replies, xml ) Need Help??


in reply to Challenge: Mystery Word Puzzle

No code (yet), just a try at an algorithm for a solution.

  1. for each of the "hint" words:
    1. delete all duplicate letters.
    2. make a list of all possible combinations of letters allowed (eg: for "bumps/2" -> bu bm bp bs um up us mp ms ps)
  2. for each of these lists of allowed letters, make all possible combinations of one item from each list (again discarding any duplicate letters in the result) which is not longer than the length of the mystery word (smaller is OK, in which case you can later "duplicate" one of the letters to "fill the gap"). Check the result with the requirements of each "hint" word (reason: by adding letters from different hint words, you may break the requirement of one of them). Put words which pass this test on a "results" list.
  3. Go through the results list (expanding words with too few letters by duplicating, triplicating, ... existing letters to fill the gaps), sort the letters and check against a dictionary of English words (preferably some sort of "inverted" dictionary with words with their letters already sorted). Put words which pass this test on a "final results list".
  4. Finished!

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://421742]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-19 19:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found