in reply to Re: Challenge: Mystery Word Puzzle
in thread Challenge: Mystery Word Puzzle

I've found a few problems with my solution (failure to handle anagrams is one), but it does the right thing in many cases. Here is some test data I've generated--solutions are all animals on some nearby books.

$length = 6; $hints = { 'blackly' => '2', 'drowsy' => '1', 'Haddad' => '1', 'desperado' => '2', 'achieving' => '2', 'cowls' => '1', 'bet' => '1', 'comprehension' => '2', 'foe' => '1', 'permeate' => '1', 'Balkanizations' => '4' };
$length = 7; $hints = { 'shortest' => '3', 'drilling' => '0', 'locked' => '2', 'messing' => '1', 'irritated' => '1', 'glory' => '1', 'modes' => '2', 'transcribed' => '3' };
$length = 5; $hints = { 'blocker' => '2', 'entropy' => '2', 'monotonously' => '4', 'resonant' => '3', 'blindfold' => '1', 'decrypts' => '2', 'inquiry' => '1', 'considered' => '3' };
And a trickier one...
$length = 5; $hints = { 'repartee' => '1', 'Kankakee' => '2', 'dewdrop' => '0', 'brushfires' => '2', 'identifiably' => '4', 'liberalizes' => '4', 'swimming' => '3', 'Geoffrey' => '0', 'dotting' => '2' };

Replies are listed 'Best First'.
Re^3: Challenge: Mystery Word Puzzle
by BrowserUk (Patriarch) on Jan 13, 2005 at 00:50 UTC

    On of these has two solutions, and the "tricky" one has three--assuming my code is correct.

    P:\test>421692-1 6 blackly:2 drowsy:1 haddad:1 desperado:2 achieving:2 + cowls:1 bet:1 comprehension:2 foe:1 permeate:1 balkanizations:4 1 fabius P:\test>421692-1 7 shortest:3 drilling:0 locked:2 messing:1 irritated: +1 glory:1 modes:2 transcribed:3 2 cutoffs offcuts P:\test>421692-1 5 blocker:2 entropy:2 monotonously:4 resonant:3 blind +fold:1 decrypts:2 inquiry:1 considered:3 1 mouse P:\test>421692-1 5 repartee:1 kankakee:2 dewdrop:0 brushfires:2 identi +fiably:4 liberalizes:4 swimming:3 geoffrey:0 dotting:2 3 nails slain snail

    Examine what is said, not who speaks.
    Silence betokens consent.
    Love the truth but pardon error.
      Where's the 'f' in the words for the second puzzle?

      Being right, does not endow the right to be rude; politeness costs nothing.
      Being unknowing, is not the same as being stupid.
      Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
      Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

        Unless I am still misunderstanding the rules, the absence of an 'f' in the hint words does not preclude it from appearing in the solution word.

        The rules only specify what must be be there, or rather, what overlaps muct be there. Except for the case when the list conatins a word with 0 (zero) overlap, in which case non of its characters can appear in the solution, but 'f' is not so excluded:

        offcuts cutoffs shortest:3 [sot] [^hre] drilling:0 [] [^drilng] locked:2 [oc] [^lked] messing:1 [s] [^meing] irritated:1 [t] [^iraed] glory:1 [o] [^glry] modes:2 [os] [^mde] transcribed:3 [tsc] [^ranibed]

        I think that means that both those are valid?

        That my dictionary does contain 'octopus', but doesn't throw it out as a solution is a bug, but I think that the 'ff's are not.


        Examine what is said, not who speaks.
        Silence betokens consent.
        Love the truth but pardon error.
      Well, I was shooting for baboon, octopus, mouse, snail. I guess the solution depends pretty critically on one's dictionary.

        As it turns out, it appears that your code is also not repecting the "all letters in the mystery word are covered by letters in the hint words" rule.

        'octopus' is not a solution to your second puzzle because 'u' does not appear in the hint words:

        $length = 7; $hints = { 'shortest' => '3', 'drilling' => '0', 'locked' => '2', 'messing' => '1', 'irritated' => '1', 'glory' => '1', 'modes' => '2', 'transcribed' => '3' };

        limbic~region's challenge is definitely more complicated than it first appears.

        I believe that I finally have my pure regex solution working.


        Examine what is said, not who speaks.
        Silence betokens consent.
        Love the truth but pardon error.