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

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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


In reply to Re: Challenge: Mystery Word Puzzle by CountZero
in thread Challenge: Mystery Word Puzzle by Limbic~Region

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (6)
As of 2024-03-28 22:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found