12 Commits

Author SHA1 Message Date
Mike Mueller
82e4665a82 Minor wording fix. 2012-03-03 14:42:58 -08:00
Mike Mueller
029ba10906 Oops, handle missing word file gracefully.
Apparently I backed out the previous change that handled this.
2012-03-03 14:41:00 -08:00
Mike Mueller
844723d28a Filter duplicate words in puzzles.
Was occasionally generating a puzzle foo > --- > --- > foo.  Oops.
2012-03-02 17:23:31 -08:00
Mike Mueller
a443d66473 Fix a performance issue in _find_solutions.
WordTwist successors can take you in circles (scare > stare > scare),
so check for this condition to avoid generating overly many potential
solutions.
2012-03-02 17:04:21 -08:00
Mike Mueller
17d1f91f8c Revise game difficulty settings.
Instead of taking lengths, the games now take easy|medium|hard|evil.
These values correspond to a range of puzzle lengths, word lengths, and
number of possible solutions.  I attempted to tune them to reasonable
values, but I could see them changing.

Also did a little more code clean-up.
2012-03-02 16:46:54 -08:00
Mike Mueller
b519259f54 Update copyright information. 2012-03-02 15:25:44 -08:00
Mike Mueller
51ca3bedfd Improve WordShrink's is_trivial definition.
No substrings should occur in any word of any solution (not just two
successive words).  This is really going to narrow down the set of puzzles,
hopefully it doesn't churn or get repetitive.
2012-02-24 20:18:36 -08:00
Mike Mueller
5e570f61c1 Refactor, optimize, clean-up.
The two games have a lot in common, so factored out a base class called
WordChain that implements most of the logic.  The game-specific behaviors
are implemented in the (now smaller) WordTwist and WordShrink classes.

Optimized to build a map of word relationships first and then derive all game
behavior from that map.  This could probably be improved even more, but for
the moment it is working nicely.
2012-02-24 19:17:05 -08:00
Mike Mueller
25136ae926 Fix a bug in error reporting. 2012-02-24 01:04:10 -08:00
Mike Mueller
e74ca803fe Restrict input snarfing a bit.
Only attempt to validate responses that look like words.
2012-02-24 00:33:14 -08:00
Mike Mueller
180252e826 Handle missing wordfile gracefully. 2012-02-24 03:21:45 -05:00
Mike Mueller
4afb3cbe3e Initial commit! 2012-02-24 00:10:33 -08:00