in reply to Challenge: Mystery Word Puzzle
The only hitch is making sure that the DICT contains all the possible legal words. E.g. your typical /usr/dict/words isn't likely to have "seams" in it, so you'd have to generate it.my @solutions; word: while (<DICT>) { chomp; for my $hint ( keys %hints ) { letters_in_common( $_, $hint ) == $hints{$hint} or next word; } push @solutions, $_; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Challenge: Mystery Word Puzzle
by Roy Johnson (Monsignor) on Jan 12, 2005 at 20:35 UTC | |
Re^2: Challenge: Mystery Word Puzzle
by Not_a_Number (Prior) on Jan 12, 2005 at 20:32 UTC | |
by jdporter (Paladin) on Jan 12, 2005 at 22:18 UTC | |
Re^2: Challenge: Mystery Word Puzzle
by Limbic~Region (Chancellor) on Jan 12, 2005 at 20:00 UTC |