assertion failures in portrait-type grids; retire an unused array in
the game generation function (my original generation strategy needed
it, but the final one didn't); correct a typo; further restrict the
generable sizes of game and include a special case for 4x4dt to
prevent a tight loop.
[originally from svn r6405]
maxflow.c. Also in this checkin, fixes to the OS X and GTK back ends
to get ALIGN_VNORMAL right. This is the first time I've used it! :-)
[originally from svn r6390]
using unwrappered malloc/free, leaving plenty of openings for out-
of-memory segfaults. Switch to using Puzzles's memory management,
which I should have done right at the start but can only assume I
forgot about.
[originally from svn r6388]
differs between oldstate and state in only the hint bit should not
have a flip animation even if hints_active is TRUE. Flip animations
should only happen for tiles which are changing their primary state.
(Put like that, it seems so obvious.)
Test case which demonstrates this fix to be right and r6384 to be
wrong: 3x3:101000000000000000000,300 . Hit Solve immediately and
then click on the red-highlighted squares.
[originally from svn r6385]
[r6384 == dd175e490a197026210ba4432eec6236971c6173]
always got a flip animation even when it wasn't one of the ones
being turned, and a square with no effect at all was still counting
as a move.
Since it's an invariant of Flip's internal generator that every
square includes itself as an effect, this never comes up in auto-
generated games.
[originally from svn r6384]
in the game description, the solver will fail to notice it and
overrun an array leading to assertion failure, silent wrong answers
or (in extreme cases) segfaults. Hence, validate_desc() now spots
them and kicks them out.
[originally from svn r6383]
game_print(), wherever feasible. This fixes a specific bug in Loopy
(James H's new field ds->linewidth wasn't being set up, leading to
corrupted print output), but I've made the change in all affected
files because it also seems like a generally good idea to encourage
it for future games, to prevent other problems of this type.
There is one slight snag, which is that Map _can't_ do this because
its game_set_size() also initialises a blitter. I could fix this by
abstracting the common parts of Map's game_set_size() out into a
subfunction called by game_set_size() and also called directly by
game_print(); alternatively, I could introduce a means of
determining whether a `drawing *' was for screen or printing use.
Not sure which yet.
[originally from svn r6340]
eliminates gratuitous duplication of the solver state every time it
goes round the main loop, in favour of the usual type of
`done_something' flag.
[originally from svn r6322]
- remove the backtracking `Hard' level, on the grounds that it was
incredibly slow and not really usable.
- introduce an `Easy' difficulty level below the standard one; many
people seem to find this puzzle unusually hard, so an easy level
is particularly helpful.
- highlight unfulfillable clue squares (but not yet any other types
of obvious error).
[originally from svn r6299]
r6160, I completely failed to ensure that generated grids were _at
most_ the required difficulty. It appears to have been only random
chance that prevented a request for a Trivial puzzle from producing
Extreme. Here's a one-line fix.
[originally from svn r6298]
[r6160 == e55838bc9b0d173ca539d0cfe714495b5c12b9dd]
ago, and nearly changed it to the obvious thing. After some thought,
though, I've decided the `bug' is better off unfixed, and added a
comment explaining why.
[originally from svn r6293]
Gareth managed to find an example (10x8#458168771440033 in r6289)
where running it in only one direction failed to eliminate an
obviously redundant piece of path.
[originally from svn r6290]
[r6289 == b25fcc3f2621b0b41f3ae7cdabe57ed07f62d2c2]
completion, _again_. In r6174 I changed it from dsf to conventional
graph theory so that it could actually highlight loops as opposed to
just discovering that one existed. Unfortunately, yesterday I
discovered a fundamental graph-theoretic error in the latter
algorithm: if you had two entirely separate loops connected by a
single path, the path would be highlighted as well as the loops.
Therefore, I've reverted to the original dsf technique, combined
with a subsequent pass to trace around each loop discovered. This
version seems to do a better job of only highlighting the actual
loops.
[originally from svn r6283]
[r6174 == 2bd8e241a93165a99f5e2c4a2dd9c3b3b1e3c6f3]
increment the deaths counter. In doing so, I incorrectly handled the
borderline case, so that a death incurred _in the act_ of collecting
the final gem also didn't increment the deaths counter. Now it does.
[originally from svn r6277]
size of the puzzle window. This has involved some _completely
stupid_ window manipulation: in order to figure out in advance how
big I want my main window to be, I first have to _create_ the status
bar so I know how tall it is; but since I can't reparent it into my
main window after I've created it, I then have to throw that status
bar away and create a new one. *sigh*
[originally from svn r6276]
to call game_set_size() twice on the same drawstate. Finally, a
definite decision: it isn't. Accordingly, midend.c arranges never to
do so, the devel docs state that puzzles may enforce by assertion
that it never happens, and the four puzzles which care (i.e. use
blitters) do so.
[originally from svn r6274]
one is <game>_TILESIZE, adjusting the game's default size. I
anticipate that this will probably _mostly_ be useful for debugging.
[originally from svn r6269]
cleanliness), plus he's enlarged the pencil-mark circles from
TILESIZE/8 to TILESIZE/7. Makes no difference at all (thanks to
integer division) when TILESIZE is the default of 20, but presumably
helps at some other tile sizes. Fine by me.
[originally from svn r6265]
a non-recursive level above Easy, which therefore moves the
recursive Hard mode further up still. Play-testing suggests that in
fact Tricky is often _harder_ than the old Hard mode, since the
latter had limited depth of recursion and would therefore spot
complex deductions only if it happened to start a recursion on the
right square; Tricky may be limited in the sophistication of its
complex deductions, but it never misses one, so its puzzles tend to
be hard all over.
Also in this checkin, a new source file `nullfe.c', containing all
the annoying stub functions required to make command-line solvers
link successfully. James wrote this for (the new) lightupsolver, and
I've used it to simplify the other stand-alone solvers.
[originally from svn r6254]
it had a command-line solver. In order to do this, I've had to
expose the internal region numbering because the solver has to have
some way to state which region it means; and in any case it's also
useful to have human-visible region numbering so that two people can
discuss a puzzle they're solving together. So pressing L during play
now toggles the display of region numbers; and `mapsolver' uses
those same numbers when showing its working and its solutions.
[originally from svn r6244]