12 Commits

Author SHA1 Message Date
73daff3937 Changed my mind about midend_is_solved: I've now reprototyped it as
midend_status(), and given it three return codes for win, (permanent)
loss and game-still-in-play. Depending on what the front end wants to
use it for, it may find any or all of these three states worth
distinguishing from each other.

(I suppose a further enhancement might be to add _non_-permanent loss
as a fourth distinct status, to describe situations in which you can't
play further without pressing Undo but doing so is not completely
pointless. That might reasonably include dead-end situations in Same
Game and Pegs, and blown-self-up situations in Mines and Inertia.
However, I haven't done this at present.)

[originally from svn r9179]
2011-06-19 13:43:35 +00:00
bd539ae870 Having played Keen a bit following the clue-generation fix in r9165,
I've decided that the extremely low density of one-option
multiplication clues is not a universally good idea after all: it
seems to me to make puzzles _quantitatively_ harder, even if Keen's
difficulty-level system can't see any difference in the set of modes
of reasoning required at least once to solve the grid.

So I've readjusted the clue selection, so that multiplicative clues
with only one workable pair of factors are restored to 'good' status
at Normal difficulty level and below, and only considered less-than-
fully-desirable at Hard and above. I think that's a reasonable
compromise.

[originally from svn r9170]
[r9165 == e7b2a9dd8d8915802fb69ce2242b1f913b7f3172]
2011-05-07 13:22:17 +00:00
e7b2a9dd8d Having looked at Keen's clue selection code, I also notice that the
intended behaviour of classifying multiplication clues as low-quality
if they only left one possible pair of multiplicands has never
actually worked, because I should have compared the possible clue
count against 2 rather than 1 since the multiplicands can occur either
way round.

[originally from svn r9165]
2011-05-04 18:22:15 +00:00
2efc77d2fd Fix warnings generated by gcc 4.6.0 about variables set but not
thereafter read. Most of these changes are just removal of pointless
stuff or trivial reorganisations; one change is actually substantive,
and fixes a bug in Keen's clue selection (the variable 'bad' was
unreferenced not because I shouldn't have set it, but because I
_should_ have referenced it!).

[originally from svn r9164]
2011-05-04 18:22:14 +00:00
980880be1f Add a function to every game backend which indicates whether a game
state is in a solved position, and a midend function wrapping it.

(Or, at least, a situation in which further play is pointless. The
point is, given that game state, would it be a good idea for a front
end that does that sort of thing to proactively provide the option to
start a fresh game?)

[originally from svn r9140]
2011-04-02 16:19:12 +00:00
19fa275b6a Patch from Ben Hutchings to fix an error-checking goof: Keen
division clues were failing to light up as erroneous if the quotient
of the numbers in them came out right under rounded-down C integer
division (e.g. 2 and 5 would be accepted for a 2/ clue). Apparently
I copied the code that invents clues in the generator straight into
the solution checker, without remembering that the generator was
allowed to do it that way because exact divisibility had been
checked elsewhere.

[originally from svn r8951]
2010-05-16 06:58:09 +00:00
3c6280ef8b Memory leak fix from James H.
[originally from svn r8850]
2010-01-18 21:23:25 +00:00
81c65eeac1 Missing piece of code I should have cribbed from Solo: we have to
lay out large numbers of pencil marks differently in a square
containing a clue.

[originally from svn r8807]
2010-01-05 18:26:44 +00:00
c3c186d687 Another 16-bit-cleanliness fix (and for once I spotted it before James!)
[originally from svn r8806]
2010-01-05 18:26:42 +00:00
56b421a632 16-bit cleanliness patch from James H.
[originally from svn r8803]
2010-01-04 18:55:56 +00:00
79bb9c00b3 Couple of missing 'static's.
[originally from svn r8801]
2010-01-01 19:41:59 +00:00
514bd502be New puzzle! 'Keen', a clone of KenKen.
[originally from svn r8796]
2009-12-27 10:01:23 +00:00