sgt/puzzles
13 years agoFix an amusing cut-and-paste error in the Java drawing code which was
simon [Tue, 5 Apr 2011 18:05:57 +0000 (18:05 +0000)]
Fix an amusing cut-and-paste error in the Java drawing code which was
causing complete mis-draws - but only when the window was exactly the
right size!

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

13 years agoAdjust the yellow used for LINE_UNKNOWN so that it's always a bit
simon [Tue, 5 Apr 2011 17:45:48 +0000 (17:45 +0000)]
Adjust the yellow used for LINE_UNKNOWN so that it's always a bit
darker than the background, because the Java front end demonstrates
that it's a bit eyewatering when it _matches_ the background.

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

13 years agoTrivial markup fix.
simon [Sun, 3 Apr 2011 09:16:08 +0000 (09:16 +0000)]
Trivial markup fix.

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

13 years agoAdd a new deduction to Easy level, which is as small as I can make it
simon [Sun, 3 Apr 2011 07:59:35 +0000 (07:59 +0000)]
Add a new deduction to Easy level, which is as small as I can make it
to have the effect of enabling large Easy-level grids to be
constructed in all grid types. Without this, some generations at Easy
level (e.g. 'loopy --generate 1 7x7t9de') can spin forever because
_even with all clues filled in_ the generated grids can't be solved at
that level.

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

13 years agoMove up midend_is_solved() in the developer docs from subheading to
simon [Sun, 3 Apr 2011 07:55:18 +0000 (07:55 +0000)]
Move up midend_is_solved() in the developer docs from subheading to
heading level. It's _almost_ apt to have it as a subheading of
midend_solve(), but not quite, and it certainly wasn't intentional - I
must have absentmindedly typed the wrong Halibut command letter.

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

13 years agoAdd a function to every game backend which indicates whether a game
simon [Sat, 2 Apr 2011 16:19:12 +0000 (16:19 +0000)]
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?)

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

13 years agoAdd functions provided by the midend to tell a front end whether GUI
simon [Sat, 2 Apr 2011 15:36:30 +0000 (15:36 +0000)]
Add functions provided by the midend to tell a front end whether GUI
buttons for undo and redo should currently be greyed out.

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

13 years agoRework the Loopy grid drawing algorithm so that it doesn't assume when
simon [Sat, 2 Apr 2011 15:19:29 +0000 (15:19 +0000)]
Rework the Loopy grid drawing algorithm so that it doesn't assume when
it clears a clipping region that it knows what features will need
redrawing in that region. Instead, I've moved all the clip/unclip/draw
functionality out into a game_redraw_in_rect() function which checks
_everything_ on the grid to see if it lies in the region.

As far as I can tell the effect only shows up in grid types that
aren't checked in, but it makes the code look nicer too.

(It would be nicer still to avoid the brute-force loop over the whole
grid checking it against the bounding box, particularly when we're
drawing in multiple bounding boxes. But this will do for the moment.)

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

13 years agoImprove the algorithm for figuring out where the number should be
simon [Sat, 2 Apr 2011 15:19:29 +0000 (15:19 +0000)]
Improve the algorithm for figuring out where the number should be
drawn in a face: averaging the vertex positions works fine for regular
or roughly regular convex polygons, but it'll start being a pain for
odder or concave ones.

This is a kludgey brute-force algorithm; I have ideas about more
elegant ways of doing this job, but they're more fiddly, so I thought
I'd start with something that basically worked.

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

13 years agoWhen a lot of edges meet the same point - and, in particular, when
simon [Sat, 2 Apr 2011 13:15:56 +0000 (13:15 +0000)]
When a lot of edges meet the same point - and, in particular, when
they meet at sharp enough angles that the thick lines overlap
noticeably outside the circle of the point - redrawing the edges in a
different order each time looks ugly. Arrange to always redraw edges
in order of colour, so that empty lines are drawn before indeterminate
lines which in turn come before filled-in lines.

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

13 years agoAnother patch from Chris Moore implementing two more grid types, both
simon [Thu, 24 Feb 2011 19:06:49 +0000 (19:06 +0000)]
Another patch from Chris Moore implementing two more grid types, both
involving dodecagons.

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

13 years agoRetire the 'middle_face' field in 'struct grid', together with the
simon [Thu, 24 Feb 2011 19:06:48 +0000 (19:06 +0000)]
Retire the 'middle_face' field in 'struct grid', together with the
overly complicated algorithm that uses it to home in on the grid edge
closest to a mouse click. That algorithm is being stressed beyond its
limit by the new grid type, and it's unnecessary anyway given that no
sensibly sized puzzle grid is going to be big enough to make it
prohibitively expensive just to do the trivial approach of iterating
over all edges and finding the closest of the eligible ones.

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

13 years agoPatch from Chris Moore to implement an extra grid type, the 'floret'
simon [Wed, 23 Feb 2011 20:05:42 +0000 (20:05 +0000)]
Patch from Chris Moore to implement an extra grid type, the 'floret'
pentagonal tiling.

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

13 years agoPatch from Chris Moore to improve the generality of
simon [Wed, 23 Feb 2011 20:05:40 +0000 (20:05 +0000)]
Patch from Chris Moore to improve the generality of
grid_nearest_edge(), by having it search harder for a better dot to
move to in the first loop.

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

13 years agoAnother UI feature for Group: now you can click between two legend
simon [Tue, 8 Feb 2011 22:13:18 +0000 (22:13 +0000)]
Another UI feature for Group: now you can click between two legend
elements to toggle thick lines in the grid. Helps to delineate
subgroups and cosets, so it's easier to remember what you can
legitimately fill in by associativity.

(I should really stop fiddling with this game's UI; it's far too silly.)

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

13 years agoThe printing function in Bridges was unable to cope with more than two
simon [Thu, 3 Feb 2011 19:49:19 +0000 (19:49 +0000)]
The printing function in Bridges was unable to cope with more than two
bridges between a pair of islands! Good grief. How did we never spot
that before?

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

13 years agoFix error highlighting after table rearrangement.
simon [Sun, 9 Jan 2011 11:30:09 +0000 (11:30 +0000)]
Fix error highlighting after table rearrangement.

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

13 years agoAdd the ability to reorder the rows and columns in Group. It becomes
simon [Sat, 8 Jan 2011 15:53:25 +0000 (15:53 +0000)]
Add the ability to reorder the rows and columns in Group. It becomes
much easier to keep track of things if, once you've identified a
cyclic subgroup, you can move it into a contiguous correctly ordered
block.

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

13 years agoIntroduce a mechanism in Buildscr for optionally building some of the
simon [Thu, 6 Jan 2011 18:37:05 +0000 (18:37 +0000)]
Introduce a mechanism in Buildscr for optionally building some of the
(more finished) puzzles in 'unfinished', as Java applets only. (The
rationale being: puzzles in 'unfinished' can be played locally by
people who go to the extra effort of downloading and building the
source, but to play them in Java is particularly inconvenient unless I
build the Java version myself. I just won't link it from the front
page.)

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

13 years agoAlso, it's ugly to blank out pieces of the applet window in black.
simon [Sat, 6 Nov 2010 18:14:42 +0000 (18:14 +0000)]
Also, it's ugly to blank out pieces of the applet window in black.
Use the puzzle background colour, like the GTK front end does.

(I know that renders the effect of the previous commit invisible,
but it's the principle of the thing! :-)

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

13 years agoIn the Java front end, don't try to guess the puzzle rectangle's
simon [Sat, 6 Nov 2010 18:14:41 +0000 (18:14 +0000)]
In the Java front end, don't try to guess the puzzle rectangle's
width and height by assuming mirror symmetry within the containing
applet area. Instead, use the proper width and height as given back
by the C sizing function.

(In particular, this fixes a bug where the non-blanked puzzle area
appeared too tall by the height of the menu bar, probably as a
result of confusing PuzzleApplet.getHeight() with
PuzzlePanel.getHeight(). But the mirroring approach was conceptually
wrong anyway.)

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

13 years agoFixes to r8997: firstly, move the fix out of #ifdef CAIRO so that it
simon [Sat, 6 Nov 2010 17:47:46 +0000 (17:47 +0000)]
Fixes to r8997: firstly, move the fix out of #ifdef CAIRO so that it
applies to both drawing mechanisms, and secondly, make sure to paint
the spare pieces of window in the _puzzle's_ background colour
rather than the (sometimes slightly different) system default.

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

13 years agoLiam Clarke points out that the use of the word 'radius' to describe
simon [Fri, 1 Oct 2010 11:46:32 +0000 (11:46 +0000)]
Liam Clarke points out that the use of the word 'radius' to describe
the size of the rotating sections in Twiddle is a misnomer, since
it's actually measuring something more like the diameter of the
section. Replace the word throughout with 'rotating block size' or
similar.

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

13 years agoMemory leak fixes from Jonas Koelker.
simon [Mon, 20 Sep 2010 10:36:44 +0000 (10:36 +0000)]
Memory leak fixes from Jonas Koelker.

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

13 years agoJonas Koelker reports that using the version of GTK currently in
simon [Tue, 14 Sep 2010 10:55:06 +0000 (10:55 +0000)]
Jonas Koelker reports that using the version of GTK currently in
Debian sid (2.20.1), there's a redraw problem when the window has a
different aspect ratio from the puzzle (due to resizing or
maximising): pieces of the window outside the real puzzle rectangle
don't get redrawn when exposed (e.g. by the drop-down menus).

Introduced code to explicitly redraw the whole exposed area,
including the parts that fall outside the pixmap. This makes the
problem go away in my hasty test install of sid, and doesn't seem to
affect the build on lenny.

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

13 years agoNew puzzle from Jonas Koelker: 'Range', an implementation of the
simon [Tue, 14 Sep 2010 09:31:52 +0000 (09:31 +0000)]
New puzzle from Jonas Koelker: 'Range', an implementation of the
puzzle variously known (depending on which website you look at) as
Kurodoko, Kuromasu or 'Where is Black Cells'.

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

13 years agoUpdate ignore properties on the unfinished subdir.
simon [Tue, 14 Sep 2010 09:30:39 +0000 (09:30 +0000)]
Update ignore properties on the unfinished subdir.

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

13 years agoPatch from Jonas Koelker to fix a double free in magnetssolver.
simon [Sun, 4 Jul 2010 22:57:05 +0000 (22:57 +0000)]
Patch from Jonas Koelker to fix a double free in magnetssolver.

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

13 years agoSome minor fixes to the unfinished Pearl solver:
simon [Sun, 27 Jun 2010 11:17:27 +0000 (11:17 +0000)]
Some minor fixes to the unfinished Pearl solver:
 - move critical correctness checks out of diagnostic ifdefs (ahem)
 - move declarations to before conditionally compiled code (we don't
   build in C99 mode round here)
 - tidy up an unsightly blank line while I'm here.

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

13 years agoSome kernels don't like my #! line. Move the -w into a 'use
simon [Sun, 30 May 2010 22:48:31 +0000 (22:48 +0000)]
Some kernels don't like my #! line. Move the -w into a 'use
warnings;' to make it simpler.

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

13 years agoPatch from Mark Wooding to add documentation of the new
simon [Sat, 29 May 2010 15:43:52 +0000 (15:43 +0000)]
Patch from Mark Wooding to add documentation of the new
draw_thick_line function, and also add some general thoughts on how
to draw puzzles' windows in an antialiasing-friendly way.

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

13 years agoPatch from Mark Wooding to add antialiasing-safety in repeated
simon [Sat, 29 May 2010 15:43:50 +0000 (15:43 +0000)]
Patch from Mark Wooding to add antialiasing-safety in repeated
redrawing of inequality signs in Unequal (which are redrawn when
they change colour).

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

13 years agoPatch from Mark Wooding to reorganise Loopy's redraw function to be
simon [Sat, 29 May 2010 15:43:48 +0000 (15:43 +0000)]
Patch from Mark Wooding to reorganise Loopy's redraw function to be
properly antialiasing-safe: all redraws are now done by clearing a
rectangle of the image, clipping to that rectangle, and redrawing
everything in it exactly once.

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

13 years agoPatch from Mark Wooding to introduce a draw_thick_line() function in
simon [Sat, 29 May 2010 15:43:46 +0000 (15:43 +0000)]
Patch from Mark Wooding to introduce a draw_thick_line() function in
the drawing API, for use by Loopy. It's optional: drawing.c will
construct an acceptable alternative using a filled polygon if the
front end doesn't provide it.

Net and Netslide previously had static functions called
draw_thick_line(), whose claim to the name is less justified and so
they've been renamed.

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

13 years agoPatch from Mark Wooding to (optionally at compile time) use the
simon [Sat, 29 May 2010 15:43:42 +0000 (15:43 +0000)]
Patch from Mark Wooding to (optionally at compile time) use the
Cairo rendering library in place of GDK, which provides pretty
antialiased graphics much like we get on MacOS. Inertia and Untangle
are perhaps the two games most obviously improved by this.

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

13 years agoPatch from Mark Wooding to disable GTK's internal double buffering,
simon [Sat, 29 May 2010 15:43:41 +0000 (15:43 +0000)]
Patch from Mark Wooding to disable GTK's internal double buffering,
which I didn't know about, but which is clearly a waste of effort
since we keep our own backing pixmap for the puzzle window.

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

13 years agoPatch from Mark Wooding to use GTK stock items for standard 'OK',
simon [Sat, 29 May 2010 15:43:40 +0000 (15:43 +0000)]
Patch from Mark Wooding to use GTK stock items for standard 'OK',
'Yes' and 'No' buttons, which means they get the standard icons that
go on those button types. Also reorders yes/no boxes so that they're
the GNOME standard way round.

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

13 years agoMake mkfiles.pl clean under 'perl -w'. Fixes one minor bug in the
simon [Sat, 29 May 2010 13:44:12 +0000 (13:44 +0000)]
Make mkfiles.pl clean under 'perl -w'. Fixes one minor bug in the
output (a comment from Recipe mistakenly got into the Unix
makefile); more importantly, lets mkfiles.pl run in up-to-date Perls
(where implicit split to @_ is now obsolete).

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

13 years agoPatch from Ben Hutchings to fix an error-checking goof: Keen
simon [Sun, 16 May 2010 06:58:09 +0000 (06:58 +0000)]
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.

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

14 years agoA user points out that Signpost doesn't in fact use the numeric
simon [Sun, 9 May 2010 07:22:16 +0000 (07:22 +0000)]
A user points out that Signpost doesn't in fact use the numeric
keypad, so it shouldn't have the REQUIRE_NUMPAD flag.

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

14 years agoFix a build-breaking bug I introduced to the OS X makefile in r8931.
simon [Mon, 26 Apr 2010 17:26:38 +0000 (17:26 +0000)]
Fix a build-breaking bug I introduced to the OS X makefile in r8931.
(Missed off the explicit -o from the compile lines constructing
version.{i386,ppc}.o, causing both to be compiled as version.o and
dependent build steps to fail.)

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

14 years agoAdd version2.def to the list of svn:ignored files.
simon [Sun, 25 Apr 2010 14:57:43 +0000 (14:57 +0000)]
Add version2.def to the list of svn:ignored files.

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

14 years agoModification of a patch from Debian: eliminate the endless rebuilds
simon [Sun, 25 Apr 2010 14:57:21 +0000 (14:57 +0000)]
Modification of a patch from Debian: eliminate the endless rebuilds
of basically unchanged binaries due to the compulsory rebuild of
version.o. version.o now depends normally on version2.def, which is
constructed using much the same if statements that version.o used to
use, except that it's not overwritten at all if its contents don't
need to change.

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

14 years agoPatch idea from Debian, but modified considerably in implementation:
simon [Sun, 25 Apr 2010 14:57:20 +0000 (14:57 +0000)]
Patch idea from Debian, but modified considerably in implementation:
introduce a new colour in Slant (COL_FILLEDSQUARE) which is used for
the background of any grid square that has a diagonal line in it.
This makes it easier to spot the one square on a giant board you
forgot to fill in, but on the other hand I found it to look very
strange and disconcerting. So I've set the colour to be identical to
COL_BACKGROUND by default, and users who like the idea can enable it
by environment variable or by local patch.

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

14 years agoPatch from Debian, to bring the use of the X selection/clipboard in
simon [Sun, 25 Apr 2010 14:57:19 +0000 (14:57 +0000)]
Patch from Debian, to bring the use of the X selection/clipboard in
line with freedesktop.org. (This is relatively simple for Puzzles,
since it only writes to the clipboard and never reads it, so the
question of which selection to use when is most easily dealt with by
always writing to both.)

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

14 years agoWording tweaks inspired by (but not the same as) some in a Debian
simon [Sun, 18 Apr 2010 15:07:54 +0000 (15:07 +0000)]
Wording tweaks inspired by (but not the same as) some in a Debian
downstream patch.

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

14 years agoPatch from Ben Hutchings: explicitly initialise something which some
simon [Sun, 18 Apr 2010 15:07:52 +0000 (15:07 +0000)]
Patch from Ben Hutchings: explicitly initialise something which some
gccs complained about.

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

14 years agoFix incorrect uses of ctype.h (passing it uncast chars, or other
simon [Sat, 17 Apr 2010 13:27:15 +0000 (13:27 +0000)]
Fix incorrect uses of ctype.h (passing it uncast chars, or other
things potentially not in the range 0..255).

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

14 years agoFix from James H for an assertion failure during Signpost
simon [Sat, 17 Apr 2010 13:27:12 +0000 (13:27 +0000)]
Fix from James H for an assertion failure during Signpost
generation. To reproduce, try 'signpost --generate 1 7x7#12345-162'.

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

14 years agoAdd '-v' option to patternsolver, to make it show its working.
simon [Fri, 2 Apr 2010 10:20:58 +0000 (10:20 +0000)]
Add '-v' option to patternsolver, to make it show its working.

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

14 years agoDylan O'Donnell reports that Signpost hangs on trying to generate a
simon [Fri, 2 Apr 2010 07:21:34 +0000 (07:21 +0000)]
Dylan O'Donnell reports that Signpost hangs on trying to generate a
2x2 puzzle. Rule it out in validate_params().

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

14 years agoChris Boyle reports an off-by-two error ('a Qui-Gon Jinx' :-) in
simon [Sun, 21 Mar 2010 14:30:49 +0000 (14:30 +0000)]
Chris Boyle reports an off-by-two error ('a Qui-Gon Jinx' :-) in
difficulty selection in Unequal's solver. I suspect I missed this
when I refactored latin.c and its callers.

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

14 years agoError highlighting bug in Bridges: when counting the number of extra
simon [Sun, 21 Mar 2010 08:48:29 +0000 (08:48 +0000)]
Error highlighting bug in Bridges: when counting the number of extra
bridges that could go to an island, the game was not correctly
accounting for existing bridges in all circumstances.

(E.g. in 7x7m2:2a6a2a1g4a6c4i1a1h23c2b, connect the top right 1 to
the 2 left of it, and the 6 left of that correctly lights up red.
But now connect the 6 to the 6 below it, and it wrongly unlights
again.)

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

14 years agoAnother w/h transposition typo.
simon [Wed, 24 Feb 2010 19:30:03 +0000 (19:30 +0000)]
Another w/h transposition typo.

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

14 years agoTypo affecting gameplay on grids wider than they are tall. (Clicking
simon [Wed, 24 Feb 2010 18:06:59 +0000 (18:06 +0000)]
Typo affecting gameplay on grids wider than they are tall. (Clicking
in columns with x > h was being erroneously rejected.)

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

14 years agoFixes from James H to the numbering of squares, in particular:
simon [Mon, 22 Feb 2010 23:14:46 +0000 (23:14 +0000)]
Fixes from James H to the numbering of squares, in particular:
 - sometimes two regions would get the same letter
 - immutable numbers could sometimes be modified
 - immutable numbers are now not flagged as errors when they clash
   (same as Solo's policy)

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

14 years agoFix build failure on MacOS by initialising a variable which was
simon [Thu, 18 Feb 2010 18:12:12 +0000 (18:12 +0000)]
Fix build failure on MacOS by initialising a variable which was
reported as potentially-unused. (In fact, as far as I can tell, it's
only ever uninitialised in assertion-failing code paths, so not a
real bug.)

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

14 years agoA proper fix from James H for the negative number issue: the
simon [Wed, 17 Feb 2010 19:15:04 +0000 (19:15 +0000)]
A proper fix from James H for the negative number issue: the
assertion I crudely commented out has now been replaced with code
that clearly shows what you did wrong in the failing situation.

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

14 years agoTypo fix (from Debian).
jacob [Wed, 17 Feb 2010 02:37:40 +0000 (02:37 +0000)]
Typo fix (from Debian).

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

14 years agoCapitalisation glitch.
simon [Tue, 16 Feb 2010 21:49:17 +0000 (21:49 +0000)]
Capitalisation glitch.

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

14 years ago'Fix' an assertion failure during play: accidentally connecting a
simon [Tue, 16 Feb 2010 15:13:28 +0000 (15:13 +0000)]
'Fix' an assertion failure during play: accidentally connecting a
long chain to a square numbered so low that the start of the chain
would have to go into negative numbers should not crash the game,
particularly when it happens as a momentary in-passing illustration.

I've fixed it for the moment just by removing the assertion. There's
probably a better fix which causes something less strange to happen
to the display as a result.

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

14 years agoDocs and comments fixes from James H.
simon [Tue, 16 Feb 2010 10:48:25 +0000 (10:48 +0000)]
Docs and comments fixes from James H.

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

14 years agoUpdates to the new-puzzle checklist, since the world has moved on.
simon [Mon, 15 Feb 2010 21:31:58 +0000 (21:31 +0000)]
Updates to the new-puzzle checklist, since the world has moved on.

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

14 years agoNew puzzle! Setting what might be a record for how long we've sat on
simon [Mon, 15 Feb 2010 21:09:09 +0000 (21:09 +0000)]
New puzzle! Setting what might be a record for how long we've sat on
a puzzle before it was ready to commit, here is 'Signpost': a clone
of janko.at's "Arrow Path", by James Harvey.

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

14 years agoPatch inspired by one from James H: remove spurious references to
simon [Tue, 19 Jan 2010 00:56:37 +0000 (00:56 +0000)]
Patch inspired by one from James H: remove spurious references to
$mw (it should only ever have been used in the Cygwin makefile), and
move the libraries to the end of the link line in the Unix makefile
for better portability.

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

14 years agoFix from James H: the shared code between drawing and printing
simon [Mon, 18 Jan 2010 21:23:27 +0000 (21:23 +0000)]
Fix from James H: the shared code between drawing and printing
should use state->adjacent rather than ds->adjacent, because the
latter won't be initialised in printing mode.

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

14 years agoFix from James H: in printing mode, the shared code between drawing
simon [Mon, 18 Jan 2010 21:23:26 +0000 (21:23 +0000)]
Fix from James H: in printing mode, the shared code between drawing
and printing must avoid referring to stuff in the game_drawstate,
since the game_drawstate isn't a real one.

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

14 years agoMemory leak fix from James H.
simon [Mon, 18 Jan 2010 21:23:25 +0000 (21:23 +0000)]
Memory leak fix from James H.

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

14 years agoPatch from James H to fix a bug in which ambiguous puzzles would
simon [Sun, 17 Jan 2010 01:05:55 +0000 (01:05 +0000)]
Patch from James H to fix a bug in which ambiguous puzzles would
occasionally be generated, e.g. by 8x8de#417341658689473 .

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

14 years agoTypo/formatting fixes for Magnets documentation.
jacob [Sat, 16 Jan 2010 13:03:36 +0000 (13:03 +0000)]
Typo/formatting fixes for Magnets documentation.

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

14 years agoHighlight the sides as well as the top of a tower when it's
simon [Sat, 16 Jan 2010 12:38:15 +0000 (12:38 +0000)]
Highlight the sides as well as the top of a tower when it's
selected. I think this is a more or less aesthetically neutral
change for the actual selection, but the selection code is reused to
draw the victory flash and that's greatly improved by not having the
tower sides remain unflashed.

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

14 years agoDon't use payload strings directly as the format for printf.
simon [Wed, 13 Jan 2010 19:25:57 +0000 (19:25 +0000)]
Don't use payload strings directly as the format for printf.

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

14 years agoPlacate optimiser.
simon [Wed, 13 Jan 2010 19:25:56 +0000 (19:25 +0000)]
Placate optimiser.

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

14 years agosvn:ignore update.
simon [Wed, 13 Jan 2010 19:19:37 +0000 (19:19 +0000)]
svn:ignore update.

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

14 years agoNew puzzle from James H: 'Magnets'.
simon [Wed, 13 Jan 2010 19:12:32 +0000 (19:12 +0000)]
New puzzle from James H: 'Magnets'.

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

14 years agoCouple of small changes to Singles from James H which missed my main
simon [Tue, 12 Jan 2010 23:32:23 +0000 (23:32 +0000)]
Couple of small changes to Singles from James H which missed my main
commit: tweak the grid generation a bit, and fix the use of the
Solve function on a grid containing errors.

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

14 years agoPatch from James H: make the Windows debugging output conditional on
simon [Tue, 12 Jan 2010 23:32:22 +0000 (23:32 +0000)]
Patch from James H: make the Windows debugging output conditional on
an enabling environment variable.

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

14 years agoAdd a couple more checks to the 3d collision detection, without
simon [Tue, 12 Jan 2010 18:34:06 +0000 (18:34 +0000)]
Add a couple more checks to the 3d collision detection, without
which a click miles above the invisible RH surface of a tower would
sometimes select that tower.

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

14 years agoCorrections to Singles documentation, plus index terms.
jacob [Mon, 11 Jan 2010 22:46:02 +0000 (22:46 +0000)]
Corrections to Singles documentation, plus index terms.

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

14 years agoMisspelled keyword.
simon [Mon, 11 Jan 2010 21:27:37 +0000 (21:27 +0000)]
Misspelled keyword.

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

14 years agosvn:ignore update.
simon [Mon, 11 Jan 2010 21:21:29 +0000 (21:21 +0000)]
svn:ignore update.

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

14 years agoNew puzzle from James Harvey: 'Singles', an implementation of
simon [Mon, 11 Jan 2010 21:21:07 +0000 (21:21 +0000)]
New puzzle from James Harvey: 'Singles', an implementation of
Hitori. One infrastructure change in the process: latin.c has
acquired a utility function to generate a latin rectangle rather
than a full square.

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

14 years agoRetire the YTRANS and YUNTRANS macros in latin.[ch]. They were
simon [Mon, 11 Jan 2010 20:32:55 +0000 (20:32 +0000)]
Retire the YTRANS and YUNTRANS macros in latin.[ch]. They were
introduced to mimic similar macros in solo.c, in case Solo ever
moved over to being based on the latin.c solver framework; but even
Solo has long since lost those macros, so latin.c has no need to
keep them.

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

14 years agoThe 3-D graphics in Towers need a corresponding change on the input
simon [Mon, 11 Jan 2010 18:41:29 +0000 (18:41 +0000)]
The 3-D graphics in Towers need a corresponding change on the input
side: instead of locating a mouse click in whichever base grid
square contained the click location, we should check to see if a
tower protrudes on to that location from a neighbouring square. That
way, a click should reliably activate the tower that was actually
drawn under the mouse pointer.

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

14 years agoOops! Remove evidence of blatant clone-and-hack from Keen. :-)
simon [Mon, 11 Jan 2010 18:41:28 +0000 (18:41 +0000)]
Oops! Remove evidence of blatant clone-and-hack from Keen. :-)

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

14 years agoOops. Uncomment the difficulty exceptions! (Also add another
simon [Sat, 9 Jan 2010 17:21:36 +0000 (17:21 +0000)]
Oops. Uncomment the difficulty exceptions! (Also add another
constraint in validate_params.)

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

14 years agoNew year, new puzzle.
jacob [Fri, 8 Jan 2010 12:25:44 +0000 (12:25 +0000)]
New year, new puzzle.

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

14 years agoFix formatting.
jacob [Thu, 7 Jan 2010 20:50:49 +0000 (20:50 +0000)]
Fix formatting.

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

14 years agoCrop the Towers icon more sensibly (i.e. at all).
simon [Thu, 7 Jan 2010 19:09:58 +0000 (19:09 +0000)]
Crop the Towers icon more sensibly (i.e. at all).

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

14 years agoUpdate svn:ignore.
simon [Thu, 7 Jan 2010 18:42:21 +0000 (18:42 +0000)]
Update svn:ignore.

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

14 years agoUpgrade the graphics in Towers to include a thematically appropriate
simon [Thu, 7 Jan 2010 18:42:01 +0000 (18:42 +0000)]
Upgrade the graphics in Towers to include a thematically appropriate
3D effect. (I only committed it without so that I could preserve a
record of how the code looked before I added it.) The 3D effect can
be disabled by setting TOWERS_2D in the environment, should anybody
seriously dislike it.

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

14 years agoNew puzzle, again using the revised latin.c: 'Towers', a clone of a
simon [Thu, 7 Jan 2010 18:42:00 +0000 (18:42 +0000)]
New puzzle, again using the revised latin.c: 'Towers', a clone of a
latin-square puzzle which I've seen described by several names but
the most common is 'Skyscrapers'.

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

14 years agoMemory leak fix from James H.
simon [Thu, 7 Jan 2010 18:15:09 +0000 (18:15 +0000)]
Memory leak fix from James H.

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

14 years agoProof that check_errors() is sufficient.
simon [Tue, 5 Jan 2010 23:40:42 +0000 (23:40 +0000)]
Proof that check_errors() is sufficient.

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

14 years agoRefer to group elements by letters instead of numbers, in keeping
simon [Tue, 5 Jan 2010 23:40:41 +0000 (23:40 +0000)]
Refer to group elements by letters instead of numbers, in keeping
with usual abstract group notation. In puzzles with a clear
identity, it's called e.

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

14 years agoAdd a facility in the latin.c solver diagnostics to allow a puzzle
simon [Tue, 5 Jan 2010 23:40:40 +0000 (23:40 +0000)]
Add a facility in the latin.c solver diagnostics to allow a puzzle
to call the digit values by custom names.

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

14 years agoAdd an even more evil (!) game mode, in which it's not made
simon [Tue, 5 Jan 2010 19:52:52 +0000 (19:52 +0000)]
Add an even more evil (!) game mode, in which it's not made
immediately obvious which element of the group is the identity - at
least two elements including the identity have their rows and
columns completely blanked.

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

14 years agoYikes! Fix a misaimed 'sizeof' which I only got away with because
simon [Tue, 5 Jan 2010 18:51:42 +0000 (18:51 +0000)]
Yikes! Fix a misaimed 'sizeof' which I only got away with because
ints and pointers are usually the same size.

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

14 years agoA user asked for the < signs in Unequal to be bolder.
simon [Tue, 5 Jan 2010 18:26:55 +0000 (18:26 +0000)]
A user asked for the < signs in Unequal to be bolder.

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

14 years agoMissing piece of code I should have cribbed from Solo: we have to
simon [Tue, 5 Jan 2010 18:26:44 +0000 (18:26 +0000)]
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.

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