sgt/puzzles
18 years agoError highlighting in Map.
simon [Sun, 28 Aug 2005 13:53:07 +0000 (13:53 +0000)]
Error highlighting in Map.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6228 cda61777-01e9-0310-a592-d414129be87e

18 years agoThere seems to be some odd behaviour when GTK is asked to draw an
simon [Sun, 28 Aug 2005 13:52:58 +0000 (13:52 +0000)]
There seems to be some odd behaviour when GTK is asked to draw an
outline polygon with a clipping rectangle active. I don't know or
care whether this is GTK or my X server or what, but I'm working
around it by drawing the lines myself, which seems to sort it out.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6227 cda61777-01e9-0310-a592-d414129be87e

18 years agoHACKING.but -> devel.but
jacob [Sun, 28 Aug 2005 09:35:55 +0000 (09:35 +0000)]
HACKING.but -> devel.but

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6226 cda61777-01e9-0310-a592-d414129be87e

18 years agoFix array bounds violation in the solver. Oops.
simon [Sat, 27 Aug 2005 09:53:38 +0000 (09:53 +0000)]
Fix array bounds violation in the solver. Oops.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6225 cda61777-01e9-0310-a592-d414129be87e

18 years agoOS X seems particularly picky about possibly uninitialised
simon [Sat, 27 Aug 2005 09:35:14 +0000 (09:35 +0000)]
OS X seems particularly picky about possibly uninitialised
variables. Placate its optimiser (again).

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6223 cda61777-01e9-0310-a592-d414129be87e

18 years agoNew puzzle: `Inertia', originally written for Windows by Ben
simon [Sat, 27 Aug 2005 09:21:22 +0000 (09:21 +0000)]
New puzzle: `Inertia', originally written for Windows by Ben
Olmstead and reimplemented with the help of his source code which he
was kind enough to release into the public domain.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6222 cda61777-01e9-0310-a592-d414129be87e

18 years agoTrivial doc changes after recent prolificacy.
jacob [Fri, 26 Aug 2005 19:44:25 +0000 (19:44 +0000)]
Trivial doc changes after recent prolificacy.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6220 cda61777-01e9-0310-a592-d414129be87e

18 years agoMemory leak and type safety fixes from James H.
simon [Thu, 25 Aug 2005 18:14:54 +0000 (18:14 +0000)]
Memory leak and type safety fixes from James H.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6219 cda61777-01e9-0310-a592-d414129be87e

18 years agoPhil Bordelon points out that the general convention is to orient
simon [Thu, 25 Aug 2005 08:07:44 +0000 (08:07 +0000)]
Phil Bordelon points out that the general convention is to orient
rectangular presets in a portrait fashion.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6217 cda61777-01e9-0310-a592-d414129be87e

18 years agoMike points out that I made an error in one of the presets...
simon [Thu, 25 Aug 2005 07:57:58 +0000 (07:57 +0000)]
Mike points out that I made an error in one of the presets...

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6216 cda61777-01e9-0310-a592-d414129be87e

18 years agoOver-enthusiastic assertion introduced in the printing revamp was
simon [Wed, 24 Aug 2005 22:13:43 +0000 (22:13 +0000)]
Over-enthusiastic assertion introduced in the printing revamp was
causing Mines to crash one second after starting a game. Oops.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6214 cda61777-01e9-0310-a592-d414129be87e

18 years agoOptimiser placation for OS X gcc.
simon [Wed, 24 Aug 2005 21:44:54 +0000 (21:44 +0000)]
Optimiser placation for OS X gcc.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6212 cda61777-01e9-0310-a592-d414129be87e

18 years agoNew puzzle: `Loopy', an implementation of Nikoli's `Slither Link' or
simon [Wed, 24 Aug 2005 21:32:54 +0000 (21:32 +0000)]
New puzzle: `Loopy', an implementation of Nikoli's `Slither Link' or
`Loop the Loop' puzzle. Contributed by Mike Pinna.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6211 cda61777-01e9-0310-a592-d414129be87e

18 years agoMinor update to Solo's documentation due to Extreme mode.
simon [Wed, 24 Aug 2005 17:49:52 +0000 (17:49 +0000)]
Minor update to Solo's documentation due to Extreme mode.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6210 cda61777-01e9-0310-a592-d414129be87e

18 years agoBrand new difficulty level in Solo. The other day Gareth and I
simon [Wed, 24 Aug 2005 17:32:39 +0000 (17:32 +0000)]
Brand new difficulty level in Solo. The other day Gareth and I
independently discovered an advanced reasoning technique in Map, and
then it occurred to me that since Solo can also be considered as a
graph-colouring game the same technique ought to be applicable. And
it is; so here's a new difficulty level, `Extreme', which sits just
above Advanced. Grids graded `Extreme' by new-Solo will of course
fall into old-Solo's `Unreasonable' category (since they're not
soluble using the old set of non-recursive methods). A brief and
unscientific experiment suggests that about one in six Unreasonable
grids generated by old-Solo are classified Extreme by the new
solver; so the remaining Unreasonable mode (now containing a subset
of the grids it used to) hasn't actually become much harder.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6209 cda61777-01e9-0310-a592-d414129be87e

18 years agoDon't report an error when loading a saved game from the command
simon [Tue, 23 Aug 2005 12:49:21 +0000 (12:49 +0000)]
Don't report an error when loading a saved game from the command
line unless there really _is_ an error!

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6203 cda61777-01e9-0310-a592-d414129be87e

18 years agoJames H points out a rogue fprintf in Net's print routine.
simon [Mon, 22 Aug 2005 22:58:19 +0000 (22:58 +0000)]
James H points out a rogue fprintf in Net's print routine.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6202 cda61777-01e9-0310-a592-d414129be87e

18 years agoMemory leak in the new printing stuff, plus a couple of comment
simon [Mon, 22 Aug 2005 18:46:38 +0000 (18:46 +0000)]
Memory leak in the new printing stuff, plus a couple of comment
corrections.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6199 cda61777-01e9-0310-a592-d414129be87e

18 years ago`Solve' operation on an already solved map without an aux_info was
simon [Mon, 22 Aug 2005 09:27:52 +0000 (09:27 +0000)]
`Solve' operation on an already solved map without an aux_info was
returning NULL due to no moves being required, leading to a strange
error message. Trivial fix.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6198 cda61777-01e9-0310-a592-d414129be87e

18 years ago*blinks* I apparently didn't try _building_ the OS X port since the
simon [Sun, 21 Aug 2005 10:55:17 +0000 (10:55 +0000)]
*blinks* I apparently didn't try _building_ the OS X port since the
printing upheaval. I could have sworn I had. Oh well; small errors
fixed.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6197 cda61777-01e9-0310-a592-d414129be87e

18 years agoRetire redundant print_line_width() in Net: a relic from a failed
simon [Sat, 20 Aug 2005 15:49:43 +0000 (15:49 +0000)]
Retire redundant print_line_width() in Net: a relic from a failed
printing strategy, irrelevant to the one which worked.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6194 cda61777-01e9-0310-a592-d414129be87e

18 years agoNative Windows printing support, using the infrastructure I put in
simon [Sat, 20 Aug 2005 15:48:55 +0000 (15:48 +0000)]
Native Windows printing support, using the infrastructure I put in
place in r6190. I'm quite pleased that I didn't have to modify the
printing infrastructure _at all_ to make this work; the only source
change required outside windows.c was the addition of a trivial
utility function midend_get_params(), and that was for the benefit
of bulk puzzle generation rather than anything to do with actual
printing.

As far as I can tell, all printable puzzles now print almost
indistinguishably from the way they print under Unix. If you look
closely the font is slightly different, and the Windows standard
hatching doesn't seem to be quite as nice as the kind I did by hand
in ps.c (and, particularly annoyingly, hatched areas don't show up
at all for me when I print to a file and use gv, though they come
out fine on the printer itself); but it's all there, and it all
works.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6193 cda61777-01e9-0310-a592-d414129be87e

18 years agoRichard B points out a cut and paste error.
simon [Fri, 19 Aug 2005 12:29:08 +0000 (12:29 +0000)]
Richard B points out a cut and paste error.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6192 cda61777-01e9-0310-a592-d414129be87e

18 years agoBah, there's always one. Remove the now-erroneous `*.py' from the
simon [Fri, 19 Aug 2005 07:49:44 +0000 (07:49 +0000)]
Bah, there's always one. Remove the now-erroneous `*.py' from the
makedist script.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6191 cda61777-01e9-0310-a592-d414129be87e

18 years agoSubstantial infrastructure upheaval. I've separated the drawing API
simon [Thu, 18 Aug 2005 17:50:14 +0000 (17:50 +0000)]
Substantial infrastructure upheaval. I've separated the drawing API
as seen by the back ends from the one implemented by the front end,
and shoved a piece of middleware (drawing.c) in between to permit
interchange of multiple kinds of the latter. I've also added a
number of functions to the drawing API to permit printing as well as
on-screen drawing, and retired print.py in favour of integrated
printing done by means of that API.

The immediate visible change is that print.py is dead, and each
puzzle now does its own printing: where you would previously have
typed `print.py solo 2x3', you now type `solo --print 2x3' and it
should work in much the same way.

Advantages of the new mechanism available right now:
 - Map is now printable, because the new print function can make use
   of the output from the existing game ID decoder rather than me
   having to replicate all those fiddly algorithms in Python.
 - the new print functions can cope with non-initial game states,
   which means each puzzle supporting --print also supports
   --with-solutions.
 - there's also a --scale option permitting users to adjust the size
   of the printed puzzles.

Advantages which will be available at some point:
 - the new API should permit me to implement native printing
   mechanisms on Windows and OS X.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6190 cda61777-01e9-0310-a592-d414129be87e

18 years agoJust noticed another thing that could easily catch me out when
simon [Mon, 15 Aug 2005 14:12:07 +0000 (14:12 +0000)]
Just noticed another thing that could easily catch me out when
adding a new puzzle.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6189 cda61777-01e9-0310-a592-d414129be87e

18 years agoMemory leak fixes from James H.
simon [Sat, 13 Aug 2005 21:35:41 +0000 (21:35 +0000)]
Memory leak fixes from James H.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6188 cda61777-01e9-0310-a592-d414129be87e

18 years agoNew puzzle: `Map'. Vaguely original, for a change.
simon [Sat, 13 Aug 2005 10:43:26 +0000 (10:43 +0000)]
New puzzle: `Map'. Vaguely original, for a change.

(This puzzle is theoretically printable, but I haven't added it in
print.py since there's rather a lot of painful processing required
to get from the game ID to the puzzle's visual appearance. It
probably won't become printable unless I get round to implementing a
more integrated printing architecture.)

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6186 cda61777-01e9-0310-a592-d414129be87e

18 years agoOops. Back out a local change I shouldn't have committed in r6184.
simon [Thu, 11 Aug 2005 11:06:59 +0000 (11:06 +0000)]
Oops. Back out a local change I shouldn't have committed in r6184.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6185 cda61777-01e9-0310-a592-d414129be87e

18 years ago16-bit-cleanness fixes from James H (again). It would be really nice
simon [Thu, 11 Aug 2005 11:06:13 +0000 (11:06 +0000)]
16-bit-cleanness fixes from James H (again). It would be really nice
to have some means of automatically spotting this sort of problem on
a desktop platform, but I can't immediately think of one; building a
trick compiler which thinks `int' is 16 bits would be the obvious
option, but it would immediately break the ABIs to all the system
functions.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6184 cda61777-01e9-0310-a592-d414129be87e

18 years agoVery fiddly corrections to the loop highlighting. ERRSLASH means the
simon [Tue, 9 Aug 2005 18:09:07 +0000 (18:09 +0000)]
Very fiddly corrections to the loop highlighting. ERRSLASH means the
slash in this square is red, so it does indeed imply that some of
the edge markings are also red; but it doesn't mean _all_ the edge
markings must be red. So instead of assuming ERRSLASH implies all
edge error markers, we set the correct set of edge error markers at
the same time as setting ERRSLASH, at which point we know which kind
of slash it is so we know which ones to set.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6175 cda61777-01e9-0310-a592-d414129be87e

18 years agoImplement error checking in Slant. Clue points are now highlighted
simon [Tue, 9 Aug 2005 17:14:25 +0000 (17:14 +0000)]
Implement error checking in Slant. Clue points are now highlighted
in red if it's impossible to fulfill them (either through too many
neighbours connecting to them, or too many not connecting to them),
and edges are highlighted in red if they form part of a loop.

In order to do this I've had to revamp the redraw function
considerably. Each square is now drawn including its top and left
grid edges, but _not_ its bottom or right ones - which means that I
need to draw an extra strip of empty squares outside the actual grid
in order to draw the few pixels which appear on the grid bottom and
right borders and also to red-highlight border clues.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6174 cda61777-01e9-0310-a592-d414129be87e

18 years agoRemove conditional definition of MAX_GRIDGEN_TRIES, for consistency
simon [Sun, 7 Aug 2005 08:47:08 +0000 (08:47 +0000)]
Remove conditional definition of MAX_GRIDGEN_TRIES, for consistency
between Palm and other ports when fed the same random seed.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6172 cda61777-01e9-0310-a592-d414129be87e

18 years agoPlacate optimiser.
simon [Sun, 7 Aug 2005 08:01:51 +0000 (08:01 +0000)]
Placate optimiser.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6171 cda61777-01e9-0310-a592-d414129be87e

18 years agoStreamline `slantsolver' a bit (avoid showing advanced working on
simon [Sat, 6 Aug 2005 14:52:26 +0000 (14:52 +0000)]
Streamline `slantsolver' a bit (avoid showing advanced working on
easy puzzles, and stop having a second encoding of the difficulty
levels).

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6170 cda61777-01e9-0310-a592-d414129be87e

18 years agoDocument hard mode in Slant, and also fix an obvious memory
simon [Sat, 6 Aug 2005 10:38:34 +0000 (10:38 +0000)]
Document hard mode in Slant, and also fix an obvious memory
management error in game_configure().

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6169 cda61777-01e9-0310-a592-d414129be87e

18 years agoIntroduce an environment variable setting (SLANT_SWAP_BUTTONS=yes)
simon [Sat, 6 Aug 2005 10:33:46 +0000 (10:33 +0000)]
Introduce an environment variable setting (SLANT_SWAP_BUTTONS=yes)
to reverse the effect of the mouse buttons. Gareth has been
complaining about this for days: apparently he finds precisely the
opposite control system intuitive to me.

This is a horrendous hack, and pushes me one step closer to losing
my temper and designing a proper preferences architecture.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6168 cda61777-01e9-0310-a592-d414129be87e

18 years agoA bunch of new reasoning techniques in the Slant solver, leading to
simon [Sat, 6 Aug 2005 10:24:52 +0000 (10:24 +0000)]
A bunch of new reasoning techniques in the Slant solver, leading to
a new Hard mode. Also added a command-line `slantsolver' which can
grade puzzles and show working.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6167 cda61777-01e9-0310-a592-d414129be87e

18 years agoCleanups to completion flashes: all four of these games used to
simon [Fri, 5 Aug 2005 17:17:23 +0000 (17:17 +0000)]
Cleanups to completion flashes: all four of these games used to
redraw the whole window _every_ time game_redraw() was called during
a flash. Now they only redraw the whole window every time the
background colour actually changes. Thanks to James H for much of
the work.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6166 cda61777-01e9-0310-a592-d414129be87e

18 years agoNew puzzle: `Light Up', by James H.
simon [Thu, 4 Aug 2005 19:14:10 +0000 (19:14 +0000)]
New puzzle: `Light Up', by James H.

Also in this checkin (committed by mistake - I meant to do it
separately), a behind-the-scenes change to Slant to colour the two
non-touching classes of diagonals in different colours. Both colours
are set to black by default, but configuration by way of
SLANT_COLOUR_* can distinguish them if you want.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6164 cda61777-01e9-0310-a592-d414129be87e

18 years agoEnvironment-based configuration wasn't sensibly usable in games with
simon [Thu, 4 Aug 2005 18:09:48 +0000 (18:09 +0000)]
Environment-based configuration wasn't sensibly usable in games with
spaces in the name. Fixed. (One day I really must get round to
turning this into a proper config mechanism.)

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6163 cda61777-01e9-0310-a592-d414129be87e

18 years agoPatch from James H: tinker with the presets on SLOW_SYSTEMs.
simon [Thu, 4 Aug 2005 17:08:26 +0000 (17:08 +0000)]
Patch from James H: tinker with the presets on SLOW_SYSTEMs.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6162 cda61777-01e9-0310-a592-d414129be87e

18 years agoBug fix from James H: solve_game() was returning error messages in
simon [Thu, 4 Aug 2005 17:07:51 +0000 (17:07 +0000)]
Bug fix from James H: solve_game() was returning error messages in
the return value rather than in *error. In the old days type-
checking would have caught this, but now of course they're the same
type.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6161 cda61777-01e9-0310-a592-d414129be87e

18 years agoI am COMPLETELY GORMLESS. The Solo grid generator, when eliminating
simon [Thu, 4 Aug 2005 11:16:10 +0000 (11:16 +0000)]
I am COMPLETELY GORMLESS. The Solo grid generator, when eliminating
clues from a filled grid, was using the algorithm

 - loop over the whole grid looking for a clue (or symmetry group of
   clues) which can be safely removed
 - remove it
 - loop over the whole grid again, and so on.

This was due to my vague feeling that removing one clue might affect
whether another can be removed. Of course this can happen - two
clues can be alternative ways of deducing the same vital fact so
that removing one makes the other necessary - but what _can't_
happen is for removing one clue to make another _become_ removable,
since you can only do that by _adding_ information. In other words,
after testing a clue and determining that it can't be removed, you
never need to test it again. Thus, a much simpler algorithm is

 - loop over the possible clues (or symmetry groups) _once_, in a
   random order
 - for each clue (group), if it is removable, remove it.

This still guarantees to leave the grid in a state where no further
clues can be removed, but it greatly cuts down puzzle generation
time and also simplifies the code. I am a fool for not having
spotted this in three and a half months!

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6160 cda61777-01e9-0310-a592-d414129be87e

18 years agoCleanups from James H: a few missing statics, a precautionary cast
simon [Wed, 3 Aug 2005 12:44:51 +0000 (12:44 +0000)]
Cleanups from James H: a few missing statics, a precautionary cast
or two, a debugging fix, a couple of explicit initialisations of
variables that were previously read uninitialised, and a fix for a
whopping great big memory leak in Slant owing to me having
completely forgotten to write free_game().

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6159 cda61777-01e9-0310-a592-d414129be87e

18 years agoSlant uses the same generation strategy as Solo, despite not having
simon [Wed, 3 Aug 2005 11:06:16 +0000 (11:06 +0000)]
Slant uses the same generation strategy as Solo, despite not having
the property which devel.but claimed to be the reason why that
strategy works. A bit of thought revealed what the _real_ reason is
why this strategy works in some puzzles and not others, so I've
rewritten the paragraph to be more accurate.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6158 cda61777-01e9-0310-a592-d414129be87e

18 years agoBah! There's _always_ one. Display glitch corrected.
simon [Tue, 2 Aug 2005 23:24:03 +0000 (23:24 +0000)]
Bah! There's _always_ one. Display glitch corrected.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6156 cda61777-01e9-0310-a592-d414129be87e

18 years agoNew puzzle: `Slant', picked from the Japanese-language section of
simon [Tue, 2 Aug 2005 23:16:46 +0000 (23:16 +0000)]
New puzzle: `Slant', picked from the Japanese-language section of
nikoli.co.jp (which has quite a few puzzles that they don't seem to
have bothered to translate into English).

Minor structural change: the disjoint set forest code used in the
Net solver has come in handy again, so I've moved it out into its
own module dsf.c.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6155 cda61777-01e9-0310-a592-d414129be87e

18 years agoVarious cleanups and clarifications to devel.but; some from Richard
simon [Mon, 1 Aug 2005 11:27:01 +0000 (11:27 +0000)]
Various cleanups and clarifications to devel.but; some from Richard
B and some from me. Also an additional utility function
`random_copy' from Richard B, which he says is useful in a new
puzzle he's working on and which seems likely to come in handy again
at some point.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6153 cda61777-01e9-0310-a592-d414129be87e

18 years agoNew end-game approach to Black Box. Instead of revealing the ball
simon [Sun, 31 Jul 2005 14:56:18 +0000 (14:56 +0000)]
New end-game approach to Black Box. Instead of revealing the ball
positions immediately when you make an error, the game now reveals
as little information as is necessary to prove you wrong (including
none - if an existing laser path you know about is inconsistent with
your guesses, the game will just point it out and tell you nothing
new!) and you can try again. Errors are counted in much the same way
as deaths in Mines.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6152 cda61777-01e9-0310-a592-d414129be87e

18 years agomissing `i' in `\e'
jacob [Fri, 29 Jul 2005 23:05:10 +0000 (23:05 +0000)]
missing `i' in `\e'

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6151 cda61777-01e9-0310-a592-d414129be87e

18 years agoOne more fix from Ben H. Also switched round the arena colour
simon [Fri, 29 Jul 2005 16:45:52 +0000 (16:45 +0000)]
One more fix from Ben H. Also switched round the arena colour
selection in the redraw function, so that locked squares are no
longer displayed once the game is at an end. (It looked untidy and
disorienting for lighter-coloured locked squares to suddenly become
darker when the box was opened. You can still flip back and forth to
your previous game state using undo/redo if you want to compare the
results against your lock pattern.)

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6150 cda61777-01e9-0310-a592-d414129be87e

18 years agoVarious fixes and cleanups suggested by Ben Hutchings:
simon [Fri, 29 Jul 2005 12:07:10 +0000 (12:07 +0000)]
Various fixes and cleanups suggested by Ben Hutchings:
 - clarified wording of messages in validate_params(), including in
   particular a correction from `< 255' to `<= 255'
 - fixed random_upto() in game generation which caused the maximum
   number of balls never to be used when there was uncertainty
 - fixed widespread miscalculation of rectangular-array indices
   (multiplication by h instead of w, which would have broken
   non-square grids rather profoundly)
 - corrected an ANSI namespace violation
 - removed real functionality from the inside of assert()
   statements, so that the game should still work when compiled
   -DNDEBUG
 - couple of unnecessary linear-time loops removed.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6149 cda61777-01e9-0310-a592-d414129be87e

18 years agoBen Hutchings reports that gcc 4 gives an optimiser warning because
simon [Fri, 29 Jul 2005 11:34:02 +0000 (11:34 +0000)]
Ben Hutchings reports that gcc 4 gives an optimiser warning because
it can't tell that one branch of a particular switch is always
taken. Adding a default clause with an automatic assertion failure
apparently fixes it.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6148 cda61777-01e9-0310-a592-d414129be87e

18 years agoPatches from Ben Hutchings to fix failures of sscanf error checking.
simon [Fri, 29 Jul 2005 11:24:55 +0000 (11:24 +0000)]
Patches from Ben Hutchings to fix failures of sscanf error checking.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6147 cda61777-01e9-0310-a592-d414129be87e

18 years agoTweak a paragraph after discussion with Simon.
jacob [Fri, 29 Jul 2005 08:20:40 +0000 (08:20 +0000)]
Tweak a paragraph after discussion with Simon.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6144 cda61777-01e9-0310-a592-d414129be87e

18 years agoShiny new developer documentation to replace the old sketchy HACKING
simon [Thu, 28 Jul 2005 17:12:18 +0000 (17:12 +0000)]
Shiny new developer documentation to replace the old sketchy HACKING
guide.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6142 cda61777-01e9-0310-a592-d414129be87e

18 years agoThe very core of cross() is capable of suffering integer overflow on
simon [Sun, 24 Jul 2005 10:39:33 +0000 (10:39 +0000)]
The very core of cross() is capable of suffering integer overflow on
large puzzles. Resort to hand-hacked 64-bit arithmetic for doing dot
products; everything else remains in `long' for the moment.

(Ideally I'd auto-detect the presence of `long long' and use it in
place of my cheap plastic imitation where possible, but since I
currently don't have a configure mechanism that'll have to wait.)

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6137 cda61777-01e9-0310-a592-d414129be87e

18 years agoAnother diagnostic mode for Untangle: if compiled with
simon [Sun, 24 Jul 2005 10:09:04 +0000 (10:09 +0000)]
Another diagnostic mode for Untangle: if compiled with
`-DSHOW_CROSSINGS', it will show each edge in red if it is crossed
by anything, and in black otherwise. Distracting and not
particularly useful during play, but occasionally handy for
debugging cross().

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6136 cda61777-01e9-0310-a592-d414129be87e

18 years ago(GTK only so far) Allow the argument passed to a game binary to be
simon [Sun, 24 Jul 2005 10:05:11 +0000 (10:05 +0000)]
(GTK only so far) Allow the argument passed to a game binary to be
either a game ID or a save file name. (The former takes priority,
because you can usually find a synonym for the latter, such as by
prepending `./' or `$PWD/'.)

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6135 cda61777-01e9-0310-a592-d414129be87e

18 years agoSolve animation (currently only in Untangle) was failing to set
simon [Fri, 22 Jul 2005 12:07:56 +0000 (12:07 +0000)]
Solve animation (currently only in Untangle) was failing to set
me->anim_pos to zero, meaning that if it happened immediately after
a completion flash then anim_pos would start off half way through
its run.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6127 cda61777-01e9-0310-a592-d414129be87e

18 years agoThe `Solve' operation now rotates and/or reflects the solution grid
simon [Fri, 22 Jul 2005 11:55:50 +0000 (11:55 +0000)]
The `Solve' operation now rotates and/or reflects the solution grid
to bring it as close as possible to the current game state. This
means that if you request `Solve' after solving a puzzle yourself,
with the intention of finding out how similar your solution is to
the program's, then you will mostly see the differences in _shape_
rather than those being masked by the fact that yours happened to be
the other way up.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6126 cda61777-01e9-0310-a592-d414129be87e

18 years agoJames H profiled the new Same Game grid generator and discovered it
simon [Fri, 22 Jul 2005 11:06:57 +0000 (11:06 +0000)]
James H profiled the new Same Game grid generator and discovered it
was spending 60% of its time in shuffle(). The purpose of the
shuffle() call was to go through a largish array in random order
until we found an element that worked, so there's no actual need to
shuffle the whole array every time and I only did it out of
laziness. So I now pick a random element each time I go round the
loop, meaning I save a lot of shuffling effort whenever the loop
terminates early (which is often). I get about a factor of two speed
improvement from this small change.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6125 cda61777-01e9-0310-a592-d414129be87e

18 years agoUntil now, Same Game has been the only puzzle in this collection
simon [Thu, 21 Jul 2005 18:06:31 +0000 (18:06 +0000)]
Until now, Same Game has been the only puzzle in this collection
which is unable to guarantee that every grid it generates can be
solved. So I'm eliminating that exception: this checkin contains a
more sophisticated grid generator which does guarantee solubility.
It's a bit slow (most noticeably on the 15x10c3 preset), and the
quality of the generated grids is slightly weird (a tendency toward
small regions rather than large sweeping areas of contiguous
colour); however, I'm willing to see the latter as a feature for
now, since making the game more challenging while simultaneously
guaranteeing it to be possible sounds like an all-round win to me.

From now on I'm raising my standards for contributions to this
collection. I made this fix to Same Game because I heard a user
_automatically assume_ that any puzzle in my collection would not be
so uncouth as to generate an impossible grid; as of this checkin
that's actually true, and I intend to maintain that standard of
quality henceforth.

(Guaranteeing a _unique_ solution is more of an optional extra,
since there are many games for which it isn't a meaningful concept
or isn't particularly desirable. Which is not to say that _some_
games wouldn't be of unacceptably low quality if they failed to
guarantee uniqueness; it depends on the game.)

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6124 cda61777-01e9-0310-a592-d414129be87e

18 years agoI've been meaning to do this for ages: all the Makefiles now give
simon [Thu, 21 Jul 2005 17:26:46 +0000 (17:26 +0000)]
I've been meaning to do this for ages: all the Makefiles now give
$(XFLAGS) _after_ $(CFLAGS) on the compiler command lines, meaning
that you can provide options in XFLAGS on the makefile which will
override the ones in CFLAGS. For example, `make XFLAGS=-O0' to make
debugging easier.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6123 cda61777-01e9-0310-a592-d414129be87e

18 years agoSync with website
jacob [Wed, 20 Jul 2005 23:35:43 +0000 (23:35 +0000)]
Sync with website

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6122 cda61777-01e9-0310-a592-d414129be87e

18 years agoThe Untangle completion flash was weedy and anaemic; beef it up a
simon [Wed, 20 Jul 2005 11:05:35 +0000 (11:05 +0000)]
The Untangle completion flash was weedy and anaemic; beef it up a
bit. In particular, it now flashes between _two_ specially picked
colours (white and mid-grey), meaning that it should be visible even
if your default background colour is white; and it also flashes
twice rather than once.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6121 cda61777-01e9-0310-a592-d414129be87e

18 years agoSome attempt to explain Dominosa for those unfamiliar with dominos. (Not sure
jacob [Tue, 19 Jul 2005 19:33:49 +0000 (19:33 +0000)]
Some attempt to explain Dominosa for those unfamiliar with dominos. (Not sure
I've succeeded.)

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6120 cda61777-01e9-0310-a592-d414129be87e

18 years agoAnother fix from Chris: Guess's allow-blanks mode wasn't allowing
simon [Mon, 18 Jul 2005 19:07:36 +0000 (19:07 +0000)]
Another fix from Chris: Guess's allow-blanks mode wasn't allowing
blanks...

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6118 cda61777-01e9-0310-a592-d414129be87e

18 years agoFix to Chris's patch in r6106 (also from Chris).
simon [Mon, 18 Jul 2005 18:54:06 +0000 (18:54 +0000)]
Fix to Chris's patch in r6106 (also from Chris).

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6117 cda61777-01e9-0310-a592-d414129be87e

18 years agoSwitch Untangle to using `long' rather than `int' in its internal
simon [Sun, 17 Jul 2005 17:12:21 +0000 (17:12 +0000)]
Switch Untangle to using `long' rather than `int' in its internal
rationals, for the sake of 16-bit-int platforms such as Palm. Thanks
to James H.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6114 cda61777-01e9-0310-a592-d414129be87e

18 years agoQuite a few instances of the Cardinal Error of Ctype were turned up
simon [Sun, 17 Jul 2005 17:10:11 +0000 (17:10 +0000)]
Quite a few instances of the Cardinal Error of Ctype were turned up
by a grep I just did. Oops.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6113 cda61777-01e9-0310-a592-d414129be87e

18 years agoTwo tiny cleanup patches from James H.
simon [Sun, 17 Jul 2005 14:49:13 +0000 (14:49 +0000)]
Two tiny cleanup patches from James H.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6111 cda61777-01e9-0310-a592-d414129be87e

18 years agoGet rid of the malloc in shuffle(), by defining a subfunction
simon [Sun, 17 Jul 2005 12:12:16 +0000 (12:12 +0000)]
Get rid of the malloc in shuffle(), by defining a subfunction
memswap() which declares a fixed-size buffer on the stack and uses
it multiple times if necessary.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6107 cda61777-01e9-0310-a592-d414129be87e

18 years agoPatch from Chris Emerson: rather than dynamically calling
simon [Sun, 17 Jul 2005 11:15:50 +0000 (11:15 +0000)]
Patch from Chris Emerson: rather than dynamically calling
get_correct() at (among other things) every redraw, we call it once
at the creation of a new game_state to save CPU.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6106 cda61777-01e9-0310-a592-d414129be87e

18 years agoBlack Box: fix "reveal" button location, explain what's meant by the
jacob [Sun, 17 Jul 2005 10:33:40 +0000 (10:33 +0000)]
Black Box: fix "reveal" button location, explain what's meant by the
`firing range'

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6105 cda61777-01e9-0310-a592-d414129be87e

18 years agoUse \q{} and \by in Black Box docs.
jacob [Sun, 17 Jul 2005 10:13:41 +0000 (10:13 +0000)]
Use \q{} and \by in Black Box docs.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6104 cda61777-01e9-0310-a592-d414129be87e

18 years agoI keep forgetting to do things when adding a new puzzle, so here's a
simon [Sun, 17 Jul 2005 09:35:01 +0000 (09:35 +0000)]
I keep forgetting to do things when adding a new puzzle, so here's a
checklist.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6103 cda61777-01e9-0310-a592-d414129be87e

18 years agoBah, there's always one: failed to `svn add' blackbox.c itself!
simon [Sun, 17 Jul 2005 08:46:00 +0000 (08:46 +0000)]
Bah, there's always one: failed to `svn add' blackbox.c itself!

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6101 cda61777-01e9-0310-a592-d414129be87e

18 years agoAnother game from James H: `Black Box'.
simon [Sun, 17 Jul 2005 08:44:18 +0000 (08:44 +0000)]
Another game from James H: `Black Box'.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6100 cda61777-01e9-0310-a592-d414129be87e

18 years agoCleanups and memory leak fixes from James H.
simon [Sat, 16 Jul 2005 20:06:37 +0000 (20:06 +0000)]
Cleanups and memory leak fixes from James H.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6099 cda61777-01e9-0310-a592-d414129be87e

18 years agoSanity-checking patch from Phil Bordelon: since Solo can't cope with
simon [Sat, 16 Jul 2005 20:02:15 +0000 (20:02 +0000)]
Sanity-checking patch from Phil Bordelon: since Solo can't cope with
more than 36 distinct symbols (it runs out of alphanumerics), check
this in validate_params. I hate to do this, since I like puzzle
sizes to at least be open-ended in _principle_, but in this case
there's a fundamental UI limitation which won't be fixed by getting
a faster CPU.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6098 cda61777-01e9-0310-a592-d414129be87e

18 years agoNew puzzle: `Untangle', cloned (with the addition of random grid
simon [Sat, 16 Jul 2005 19:51:53 +0000 (19:51 +0000)]
New puzzle: `Untangle', cloned (with the addition of random grid
generation) from a simple but rather fun Flash game I saw this
morning.

Small infrastructure change for this puzzle: while most game
backends find the midend's assumption that Solve moves are never
animated to be a convenience absolving them of having to handle the
special case themselves, this one actually needs Solve to be
animated. Rather than break that convenience for the other puzzles,
I've introduced a flag bit (which I've shoved in mouse_priorities
for the moment, shamefully without changing its name).

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6097 cda61777-01e9-0310-a592-d414129be87e

18 years agoImprove speed of grid generation: I've found something simple I can
simon [Fri, 15 Jul 2005 16:43:02 +0000 (16:43 +0000)]
Improve speed of grid generation: I've found something simple I can
do during construction which massively increases (by over a factor
of four with default parameters) the probability that any given
randomly generated grid will be uniquely solvable.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6096 cda61777-01e9-0310-a592-d414129be87e

18 years agoAdd Dominosa printout support.
jacob [Thu, 14 Jul 2005 22:50:58 +0000 (22:50 +0000)]
Add Dominosa printout support.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6094 cda61777-01e9-0310-a592-d414129be87e

18 years agoCleanups to Solo:
simon [Thu, 14 Jul 2005 18:15:23 +0000 (18:15 +0000)]
Cleanups to Solo:
 - use the new `shuffle' utility function in a couple of places
 - remove the random_state parameter from solver(). It was there
   because I initially wanted to use the same solver for grid
   generation, but since I had to abandon that plan the solver now
   doesn't have any need for randomness at all.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6093 cda61777-01e9-0310-a592-d414129be87e

18 years agoNew puzzle: Dominosa.
simon [Thu, 14 Jul 2005 17:42:01 +0000 (17:42 +0000)]
New puzzle: Dominosa.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6091 cda61777-01e9-0310-a592-d414129be87e

18 years agoIntroduce a `shuffle' utility function.
simon [Thu, 14 Jul 2005 17:37:05 +0000 (17:37 +0000)]
Introduce a `shuffle' utility function.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6090 cda61777-01e9-0310-a592-d414129be87e

18 years agogame_timing_state() now has access to the game_ui. This means that
simon [Sun, 10 Jul 2005 10:17:13 +0000 (10:17 +0000)]
game_timing_state() now has access to the game_ui. This means that
whether the timer is currently going is no longer solely dependent
on the current game_state: it can be dependent on more persistent
information stored in the game_ui. In particular, Mines now freezes
the timer permanently once you complete a grid for the first time,
so that you can then backtrack through your solution process without
destroying the information about how long it took you the first time
through.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6088 cda61777-01e9-0310-a592-d414129be87e

18 years agoChange of policy on game_changed_state(). Originally, it was called
simon [Sun, 10 Jul 2005 10:06:04 +0000 (10:06 +0000)]
Change of policy on game_changed_state(). Originally, it was called
by the midend every time the game state changed _other_ than as a
result of make_move(), on the basis that when the game state changed
due to make_move() the game backend had probably noticed anyway.
However, when make_move() split up, this became more fiddly: if the
game_ui had to be updated based on some property of the final game
state, then execute_move() couldn't do it because it didn't have a
pointer to the game_ui, but it was fiddly to do it in
interpret_move() because that didn't directly have a copy of the
finished game state to examine. Same Game (the only game to be
affected) had to deal with this by actually having interpret_move()
_call_ execute_move() to construct a temporary new game state,
update the UI, and then throw it away.

So now, game_changed_state() is called _every_ time the current game
state changes, which means that if anything needs doing to the
game_ui as a result of examining the new game state, it can be done
there and save a lot of effort.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6087 cda61777-01e9-0310-a592-d414129be87e

18 years agoSubtle UI change to Mines. Although I mostly find the unified left-
simon [Sun, 10 Jul 2005 09:27:08 +0000 (09:27 +0000)]
Subtle UI change to Mines. Although I mostly find the unified left-
button interface (same button to open a closed square or to clear
around an open one) to be a massive help, there is one circumstance
in which it frequently kills me: if I click down on an open square I
want to clear around, then the mouse pointer accidentally drifts
over on to the nearest closed square before I release, I'll end up
opening that square instead and (usually) dying. So this checkin
causes Mines to note which type of square I left-clicked on, and to
do nothing if the button release is on the other type.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6086 cda61777-01e9-0310-a592-d414129be87e

18 years agoAlter the `Octagon' board preset so that instead of presenting you
simon [Sat, 9 Jul 2005 10:19:41 +0000 (10:19 +0000)]
Alter the `Octagon' board preset so that instead of presenting you
with the obvious central hole it presents you with a randomly chosen
one of twelve other holes. The reason is, the central-hole starting
position is provably insoluble (proof given in comments), so instead
we pick from the ones that are actually possible.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6083 cda61777-01e9-0310-a592-d414129be87e

18 years agoMissing quit on error was leading to an assertion failure on some
simon [Wed, 6 Jul 2005 21:24:28 +0000 (21:24 +0000)]
Missing quit on error was leading to an assertion failure on some
types of incorrectly formatted save file.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6079 cda61777-01e9-0310-a592-d414129be87e

18 years agoMove various printf()s after declarations.
jacob [Wed, 6 Jul 2005 20:10:03 +0000 (20:10 +0000)]
Move various printf()s after declarations.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6078 cda61777-01e9-0310-a592-d414129be87e

18 years agoUnify the two solvers in Solo. nsolve has now had recursion
simon [Wed, 6 Jul 2005 18:36:20 +0000 (18:36 +0000)]
Unify the two solvers in Solo. nsolve has now had recursion
capability added to it, to be used only when all else fails, and is
simply called `solver'. This means that:

 - solving of 5x5 Trivial grids using the `Solve' function, which
   previously hung for ages because rsolve happened to take a wrong
   turning at the start, is now zippy
 - solosolver doesn't require the confusing -r and -n options
 - solosolver can show its working even for Unreasonable grids.

Unfortunately, the new unified solver still isn't suitable for grid
generation. After it proved to be so much faster at solving 5x5s, I
hoped to be able to substitute it for rsolve during generation and
gain additional speed in 5x5 generation too; but no luck, because
it's slower _per recursion level_, and although during solving it
makes up for this by needing very few levels, there is a lot of
_unavoidable_ recursion during generation, especially at 5x5. A
hybrid strategy which starts off with rsolve and switches to the
unified solver at a critical point proved unsatisfactory as well,
because the critical point changes depending on the vagaries of the
recursion and can't be pinpointed easily. So rsolve is still in
there, only renamed `gridgen' because that's now all it's good for.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6077 cda61777-01e9-0310-a592-d414129be87e

18 years agoRefactoring from James H: the highlight and lowlight colour setup
simon [Wed, 6 Jul 2005 18:27:40 +0000 (18:27 +0000)]
Refactoring from James H: the highlight and lowlight colour setup
common to Fifteen, Sixteen, Twiddle and Pegs is now a utility
function in misc.c.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6076 cda61777-01e9-0310-a592-d414129be87e

18 years agoSome patches from James H:
simon [Wed, 6 Jul 2005 11:06:17 +0000 (11:06 +0000)]
Some patches from James H:
 - reinstate the initialisation of ds->w and ds->h in guess.c, which
   I'd accidentally removed during game_size() refactoring
 - reorganise Net's interpret_move() so that my uncommitted patch
   for drag-based UI (which he uses on the Palm port) will apply
   more easily
 - the interpret_move() changes make it easy to have a single move
   type which rotates a tile by 180 degrees, so this is now provided
   via the `F' key (but there's no spare button available to provide
   it via the mouse).

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6070 cda61777-01e9-0310-a592-d414129be87e

18 years agoRevert the code that assumed that incoming parameters used a random generation
jacob [Tue, 5 Jul 2005 21:40:29 +0000 (21:40 +0000)]
Revert the code that assumed that incoming parameters used a random generation
scheme in r6068, since this messed up the non-permanency of the non-limited
parameter.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6069 cda61777-01e9-0310-a592-d414129be87e

18 years agoAdd a `full' parameter to validate_params(), analogous to the one in
jacob [Tue, 5 Jul 2005 21:27:19 +0000 (21:27 +0000)]
Add a `full' parameter to validate_params(), analogous to the one in
encode_params(). This is necessary for cases where generation-time parameters
that are normally omitted from descriptive IDs can place restrictions on other
parameters; in particular, when the default value of a relevant generation-time
parameter is not the one used to generate the descriptive ID, validation could
reject self-generated IDs (e.g., Net `5x2w:56182ae7c2', and some cases in
`Pegs').

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6068 cda61777-01e9-0310-a592-d414129be87e

18 years agoEnhancements to mkfiles.pl and Recipe to arrange for the auxiliary
simon [Tue, 5 Jul 2005 19:40:32 +0000 (19:40 +0000)]
Enhancements to mkfiles.pl and Recipe to arrange for the auxiliary
command-line programs (solosolver, patternsolver, mineobfusc) to be
built as part of the normal Makefiles. This means mkfiles.pl now has
the capability to compile a source file more than once with
different #defines. Also, fixes for those auxiliary programs and one
fix in midend.c which the Borland compiler objected to while I was
testing its makefile generation.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6066 cda61777-01e9-0310-a592-d414129be87e