466 Commits

Author SHA1 Message Date
04e26aaa7b James H's memory leak fixes to Inertia.
[originally from svn r6255]
2005-09-01 11:59:51 +00:00
94b36c11e0 James H has implemented a new `Tricky' difficulty level in Light Up:
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]
2005-09-01 11:57:56 +00:00
6992530a85 Ability to drag pencil marks around.
[originally from svn r6250]
2005-08-31 19:27:41 +00:00
c70312f8a8 Terribly cunning approach to making the pencil marks look nicer,
thanks to Gareth.

[originally from svn r6248]
2005-08-31 17:34:47 +00:00
7b08221952 Debian requires -lm, where Red Hat didn't.
[originally from svn r6247]
2005-08-31 16:59:51 +00:00
068a092cd5 Ahem; forgot about recursion. Recursive solving now shows its
working as well.

[originally from svn r6245]
2005-08-31 12:43:14 +00:00
f2ff444fca Now that Map has some seriously complex deductions, it's about time
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]
2005-08-31 12:17:01 +00:00
121f664b62 Forcing chains in Map give rise to a new `Hard' difficulty level.
Also implemented the Map analogue of Solo's pencil marks, to make
this mode more playable.

[originally from svn r6240]
2005-08-30 19:42:45 +00:00
e7a02ae333 Implemented a couple more reasoning modes for Extreme difficulty
level: positional set elimination (which is so obvious I really
should have thought of it myself, though it's tricky to spot) and
forcing chains (which are a type of one-level proof by
contradiction, findable through a simple breadth-first search
without requiring recursion, but so ludicrously powerful that they
are able to solve _two thirds_ of grids that the pre-Extreme Solo
generated and rated as Unreasonable).

Of course this makes Unreasonable mode harder still...

[originally from svn r6239]
2005-08-30 17:44:18 +00:00
948c33c5a9 Backspace and Delete keys now function like Space in Solo.
[originally from svn r6237]
2005-08-29 11:12:05 +00:00
4d6c8c7337 Typo in comment :-)
[originally from svn r6236]
2005-08-29 09:14:35 +00:00
ea9142fbda Ahem. The region density at which things start to get hairy is 2/3
of the grid area, not 3/2!

[originally from svn r6235]
2005-08-29 09:05:35 +00:00
2c85fd3530 Aesthetic improvements to the Map error indicators:
- the exclamation mark was a bit dot-heavy
 - allowing the indicator to be placed at a grid point as well as
   half way between two grid points allows some much more natural
   positioning.

[originally from svn r6234]
2005-08-29 08:57:45 +00:00
2975ae2811 Unreasonable mode for Map.
[originally from svn r6229]
2005-08-28 14:29:19 +00:00
e483fc513b Error highlighting in Map.
[originally from svn r6228]
2005-08-28 13:53:07 +00:00
8f46a30e69 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.

[originally from svn r6227]
2005-08-28 13:52:58 +00:00
1d0573109c HACKING.but -> devel.but
[originally from svn r6226]
2005-08-28 09:35:55 +00:00
389397eed6 Fix array bounds violation in the solver. Oops.
[originally from svn r6225]
2005-08-27 09:53:38 +00:00
8c547d5320 OS X seems particularly picky about possibly uninitialised
variables. Placate its optimiser (again).

[originally from svn r6223]
2005-08-27 09:35:14 +00:00
622a5ff678 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.

[originally from svn r6222]
2005-08-27 09:21:22 +00:00
067f06053c Trivial doc changes after recent prolificacy.
[originally from svn r6220]
2005-08-26 19:44:25 +00:00
d6163f9976 Memory leak and type safety fixes from James H.
[originally from svn r6219]
2005-08-25 18:14:54 +00:00
2520b86965 Phil Bordelon points out that the general convention is to orient
rectangular presets in a portrait fashion.

[originally from svn r6217]
2005-08-25 08:07:44 +00:00
163d62b07f Mike points out that I made an error in one of the presets...
[originally from svn r6216]
2005-08-25 07:57:58 +00:00
c564df0828 Over-enthusiastic assertion introduced in the printing revamp was
causing Mines to crash one second after starting a game. Oops.

[originally from svn r6214]
2005-08-24 22:13:43 +00:00
5dc47a7ba1 Optimiser placation for OS X gcc.
[originally from svn r6212]
2005-08-24 21:44:54 +00:00
c9b47daf1b New puzzle: Loopy', an implementation of Nikoli's Slither Link' or
`Loop the Loop' puzzle. Contributed by Mike Pinna.

[originally from svn r6211]
2005-08-24 21:32:54 +00:00
c6fa81bfc0 Minor update to Solo's documentation due to Extreme mode.
[originally from svn r6210]
2005-08-24 17:49:52 +00:00
99f8178aab 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.

[originally from svn r6209]
2005-08-24 17:32:39 +00:00
d558bb240a Don't report an error when loading a saved game from the command
line unless there really _is_ an error!

[originally from svn r6203]
2005-08-23 12:49:21 +00:00
196695afdf James H points out a rogue fprintf in Net's print routine.
[originally from svn r6202]
2005-08-22 22:58:19 +00:00
fb6e7f1a8b Memory leak in the new printing stuff, plus a couple of comment
corrections.

[originally from svn r6199]
2005-08-22 18:46:38 +00:00
b0614e6da8 `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.

[originally from svn r6198]
2005-08-22 09:27:52 +00:00
cd76bfb25f *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.

[originally from svn r6197]
2005-08-21 10:55:17 +00:00
c136c3dde9 Retire redundant print_line_width() in Net: a relic from a failed
printing strategy, irrelevant to the one which worked.

[originally from svn r6194]
2005-08-20 15:49:43 +00:00
3bfb9b108e 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.

[originally from svn r6193]
[r6190 == af59dcf6858264103bbc621761feee3aed5aaf2a]
2005-08-20 15:48:55 +00:00
cf224a6556 Richard B points out a cut and paste error.
[originally from svn r6192]
2005-08-19 12:29:08 +00:00
ca108a017b Bah, there's always one. Remove the now-erroneous `*.py' from the
makedist script.

[originally from svn r6191]
2005-08-19 07:49:44 +00:00
af59dcf685 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.

[originally from svn r6190]
2005-08-18 17:50:14 +00:00
ca6950b0f7 Just noticed another thing that could easily catch me out when
adding a new puzzle.

[originally from svn r6189]
2005-08-15 14:12:07 +00:00
cceee3cac9 Memory leak fixes from James H.
[originally from svn r6188]
2005-08-13 21:35:41 +00:00
6ada3841a1 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.)

[originally from svn r6186]
2005-08-13 10:43:26 +00:00
12def7ede2 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.

[originally from svn r6184]
2005-08-11 11:06:13 +00:00
8da47177f3 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.

[originally from svn r6175]
2005-08-09 18:09:07 +00:00
2bd8e241a9 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.

[originally from svn r6174]
2005-08-09 17:14:25 +00:00
c8c576f689 Remove conditional definition of MAX_GRIDGEN_TRIES, for consistency
between Palm and other ports when fed the same random seed.

[originally from svn r6172]
2005-08-07 08:47:08 +00:00
6c3916f77e Placate optimiser.
[originally from svn r6171]
2005-08-07 08:01:51 +00:00
a42b11add3 Streamline `slantsolver' a bit (avoid showing advanced working on
easy puzzles, and stop having a second encoding of the difficulty
levels).

[originally from svn r6170]
2005-08-06 14:52:26 +00:00
c3d1982dcb Document hard mode in Slant, and also fix an obvious memory
management error in game_configure().

[originally from svn r6169]
2005-08-06 10:38:34 +00:00
98a9f06a67 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.

[originally from svn r6168]
2005-08-06 10:33:46 +00:00