sgt/puzzles
14 years agoAha, I've managed to prove that my inadequate error highlighting is
simon [Wed, 16 Sep 2009 10:57:11 +0000 (10:57 +0000)]
Aha, I've managed to prove that my inadequate error highlighting is
actually just about adequate after all. Large comment added
containing some discussion and the proof.

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

14 years agoError-highlighted trees look nicer with a different-coloured trunk.
simon [Sun, 13 Sep 2009 14:43:21 +0000 (14:43 +0000)]
Error-highlighted trees look nicer with a different-coloured trunk.
Also added a comment worrying about the universality of my error
highlighting mechanism.

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

14 years agoRedo Mines and Inertia's mine graphics using an actual circle rather
simon [Sun, 13 Sep 2009 13:08:34 +0000 (13:08 +0000)]
Redo Mines and Inertia's mine graphics using an actual circle rather
than an approximating octagon, to improve the look when zoomed to
high resolution.

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

14 years agoTweak to the promptness of error highlighting display.
simon [Sat, 12 Sep 2009 12:54:49 +0000 (12:54 +0000)]
Tweak to the promptness of error highlighting display.

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

14 years agoAbout time I got round to this: error highlighting for Tents.
simon [Sat, 12 Sep 2009 12:30:43 +0000 (12:30 +0000)]
About time I got round to this: error highlighting for Tents.

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

14 years agoFix width/height braino introduced in r5844.
simon [Wed, 9 Sep 2009 18:22:14 +0000 (18:22 +0000)]
Fix width/height braino introduced in r5844.

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

14 years agoAdd execute permission to the .exe files inside the zip file.
simon [Fri, 28 Aug 2009 17:43:44 +0000 (17:43 +0000)]
Add execute permission to the .exe files inside the zip file.

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

14 years agoMore defensive-coding fixes from James H.
simon [Wed, 1 Jul 2009 22:01:21 +0000 (22:01 +0000)]
More defensive-coding fixes from James H.

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

14 years agoPatch from Mark Wooding: when I did r7980 I had completely failed to
simon [Sun, 21 Jun 2009 13:49:09 +0000 (13:49 +0000)]
Patch from Mark Wooding: when I did r7980 I had completely failed to
notice that there was an _official_ way to have menu items marked as
selected or unselected, which is the GtkRadioMenuItem class. Replace
my ad-hoc use of bullet characters with that.

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

14 years agoPatch from Mark Wooding: use gdk_event_request_motions() where
simon [Sun, 21 Jun 2009 13:39:54 +0000 (13:39 +0000)]
Patch from Mark Wooding: use gdk_event_request_motions() where
available, which magically seems to eliminate most if not all of the
update lag when dragging a point in a large (say 250-point)
Untangle. I don't fully understand how this works, but it seems to!

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

14 years agoPatch from Mark Wooding: stop setting GTK_EXPAND for the x-direction
simon [Sun, 21 Jun 2009 13:34:50 +0000 (13:34 +0000)]
Patch from Mark Wooding: stop setting GTK_EXPAND for the x-direction
on labels in tables. The effect is that if you resize (e.g.) Solo's
configuration panel, the labels to the left of the various input
boxes will remain just big enough to fit their text in, and all the
extra space will be taken up by the useful part, i.e. the input
boxes themselves. Previously the labels and input boxes would expand
in a 1:1 ratio, causing lots of space to the right of the label text
that wasn't used for anything.

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

14 years agoPatch from Mark Wooding: one-pixel fix to the alignment of the
simon [Sun, 21 Jun 2009 13:28:43 +0000 (13:28 +0000)]
Patch from Mark Wooding: one-pixel fix to the alignment of the
bottom and right edges of the Tents keyboard cursor.

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

14 years agoPatch from Mark Wooding (though somewhat tampered with by me): have
simon [Sun, 21 Jun 2009 13:24:48 +0000 (13:24 +0000)]
Patch from Mark Wooding (though somewhat tampered with by me): have
Loopy mark LINE_NO grid edges with very faint lines, instead of
leaving them totally undrawn. Helps in complex grid types where the
line layout isn't entirely obvious to a player not already familiar
with it. Disableable by setting LOOPY_FAINT_LINES=n in the
environment, just in case anyone turns out to seriously dislike it.
(You could probably disable it via LOOPY_COLOUR_6 too, but you'd
have to know the exact shade of your background to get that right.)

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

14 years agoMemory management and other fixes from James H.
simon [Wed, 17 Jun 2009 20:01:45 +0000 (20:01 +0000)]
Memory management and other fixes from James H.

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

15 years agoFix a misdesign I must have missed when I reviewed the Killer patch:
simon [Thu, 30 Apr 2009 17:56:56 +0000 (17:56 +0000)]
Fix a misdesign I must have missed when I reviewed the Killer patch:
merge_some_cages() was written in the assumption that it would
always be able to do something, in that it returned void on success
and if it couldn't find anything to do it would just loop round
forever trying the same things over and over again.

Now it makes a methodical list of the pairs of cages which are merge
candidates, goes through them in a random order until it finds a
viable one, and returns a boolean indicating whether it succeeded or
ran out of candidates.

A test case which previously hung and now does not is "solo
--generate 1 7jxkdt#12345-10".

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

15 years agocheck_valid() wasn't checking that Killer cages contain at most one
simon [Wed, 29 Apr 2009 23:11:10 +0000 (23:11 +0000)]
check_valid() wasn't checking that Killer cages contain at most one
of each digit, and - perhaps more importantly - the display code
wasn't highlighting violations of that rule as an error. Fix both.

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

15 years agoIt's been a new year for some time now.
jacob [Thu, 19 Mar 2009 23:32:30 +0000 (23:32 +0000)]
It's been a new year for some time now.

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

15 years agoPatch from James H to provide 16-bit-int cleanliness in Killer Solo.
simon [Mon, 2 Mar 2009 23:32:43 +0000 (23:32 +0000)]
Patch from James H to provide 16-bit-int cleanliness in Killer Solo.

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

15 years agoPatch from James H to abstract out of Dominosa the code which
simon [Mon, 2 Mar 2009 19:45:59 +0000 (19:45 +0000)]
Patch from James H to abstract out of Dominosa the code which
randomly generates a tiling of a rectangle with dominoes, since he
wants to reuse that function in another puzzle.

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

15 years agoMake menus accessible from the keyboard in the Gtk front-end.
jacob [Sun, 1 Mar 2009 13:51:32 +0000 (13:51 +0000)]
Make menus accessible from the keyboard in the Gtk front-end.

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

15 years agoFix cosmetic glitch in the interaction between Killer and Jigsaw
simon [Tue, 24 Feb 2009 07:49:01 +0000 (07:49 +0000)]
Fix cosmetic glitch in the interaction between Killer and Jigsaw
modes.

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

15 years agoMake icon building cope with Solo's increased default tilesize as of r8455.
jacob [Mon, 23 Feb 2009 17:42:50 +0000 (17:42 +0000)]
Make icon building cope with Solo's increased default tilesize as of r8455.

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

15 years agoFix duplicate keyword.
jacob [Sun, 22 Feb 2009 12:57:20 +0000 (12:57 +0000)]
Fix duplicate keyword.

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

15 years agoA substantial patch to Solo from Bernd Schmidt, adding support for
simon [Sun, 22 Feb 2009 12:16:54 +0000 (12:16 +0000)]
A substantial patch to Solo from Bernd Schmidt, adding support for
the 'Killer Sudoku' puzzle type. As a side effect I've had to
increase the default tile size of Solo, so that the extra numbers
drawn in the squares in Killer mode were still legible.

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

15 years agoIntroduce some infrastructure to permit games' print functions to
simon [Sun, 22 Feb 2009 12:05:38 +0000 (12:05 +0000)]
Introduce some infrastructure to permit games' print functions to
draw dotted lines. No puzzle yet uses this, but one's about to.

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

15 years agoFix the Java front end's vertical text positioning when
simon [Sun, 22 Feb 2009 12:02:40 +0000 (12:02 +0000)]
Fix the Java front end's vertical text positioning when
ALIGN_VNORMAL is in use: ALIGN_VNORMAL indicates that the supplied
y-coordinate denotes the _baseline_ of the text, not its top, so
adding on 'asc' to convert to the baseline is wrong.

This only affects Tents, at present.

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

15 years agoKeyboard control patch for Bridges, from James H.
simon [Thu, 5 Feb 2009 19:29:26 +0000 (19:29 +0000)]
Keyboard control patch for Bridges, from James H.

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

15 years agoLee Dowling points out that duplicating the entire grid data
simon [Thu, 5 Feb 2009 19:25:44 +0000 (19:25 +0000)]
Lee Dowling points out that duplicating the entire grid data
structure in every game_state is terribly wasteful. Move all the
constant bits of it (i.e. everything except the per-square 'blue'
flag) into a ref-counted shared structure.

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

15 years agoKeyboard control patch for Black Box, from James H.
simon [Wed, 28 Jan 2009 18:28:41 +0000 (18:28 +0000)]
Keyboard control patch for Black Box, from James H.

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

15 years agoKeyboard control patch for Twiddle, from James H.
simon [Wed, 28 Jan 2009 18:27:10 +0000 (18:27 +0000)]
Keyboard control patch for Twiddle, from James H.

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

15 years agoKeyboard control patch for Pattern, from James H.
simon [Tue, 27 Jan 2009 18:30:46 +0000 (18:30 +0000)]
Keyboard control patch for Pattern, from James H.

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

15 years agoKeyboard control for Map, from James H.
simon [Tue, 27 Jan 2009 18:26:10 +0000 (18:26 +0000)]
Keyboard control for Map, from James H.

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

15 years agoReorder if statements in Unequal's interpret_move() so that presses
simon [Mon, 26 Jan 2009 22:28:17 +0000 (22:28 +0000)]
Reorder if statements in Unequal's interpret_move() so that presses
of 'h' and 'm' are treated as digits if a square is selected, and
only treated as special commands otherwise. This renders very large
games (just about) playable.

Idea from Ben Hutchings's collection of Debian patches, although I
had to redo his (trivial) patch myself since the code has changed
recently.

(Addendum after committing: hmm, I see Jacob already applied the
original version of the patch a while back. Looks as if the recent
keyboard control change reintroduced the problem. Still, re-fixed
now.)

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

15 years agoPatch from James H to add keyboard control in Sixteen and Netslide
simon [Mon, 26 Jan 2009 19:14:44 +0000 (19:14 +0000)]
Patch from James H to add keyboard control in Sixteen and Netslide
(and also belatedly document the keyboard support in Unequal).

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

15 years agoSwitch over to using the new-style GtkFileChooser in place of the
simon [Mon, 26 Jan 2009 19:11:34 +0000 (19:11 +0000)]
Switch over to using the new-style GtkFileChooser in place of the
deprecated GtkFileSelection, at least when the latter is available.
Patch mostly due to Ori Avtalion.

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

15 years agoAdd an automatic check for HAVE_SENSIBLE_ABSOLUTE_SIZE_FUNCTION by
simon [Sat, 24 Jan 2009 17:58:42 +0000 (17:58 +0000)]
Add an automatic check for HAVE_SENSIBLE_ABSOLUTE_SIZE_FUNCTION by
using PANGO_CHECK_VERSION. (Irritatingly, the latter is not
available in all versions of Pango, so we have to be cautious about
using it at all. *sigh*)

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

15 years agoUpdate the ignores.
simon [Thu, 22 Jan 2009 19:16:37 +0000 (19:16 +0000)]
Update the ignores.

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

15 years agoKeyboard control patch for Pegs, from James H.
simon [Tue, 20 Jan 2009 18:28:28 +0000 (18:28 +0000)]
Keyboard control patch for Pegs, from James H.

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

15 years agoKeyboard control patch for Solo, from James H.
simon [Mon, 19 Jan 2009 18:38:29 +0000 (18:38 +0000)]
Keyboard control patch for Solo, from James H.

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

15 years agoKeyboard control patch for Slant, from James H.
simon [Fri, 16 Jan 2009 18:52:18 +0000 (18:52 +0000)]
Keyboard control patch for Slant, from James H.

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

15 years agoKeyboard cursor support for Tents, from James H.
simon [Fri, 16 Jan 2009 18:50:22 +0000 (18:50 +0000)]
Keyboard cursor support for Tents, from James H.

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

15 years agor8396 introduced midend_tilesize(). Document it.
simon [Fri, 16 Jan 2009 18:45:01 +0000 (18:45 +0000)]
r8396 introduced midend_tilesize(). Document it.

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

15 years agoKeyboard cursor support for Rectangles, from James H.
simon [Thu, 15 Jan 2009 18:20:02 +0000 (18:20 +0000)]
Keyboard cursor support for Rectangles, from James H.

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

15 years agoKeyboard cursor support in Galaxies, by James H.
simon [Thu, 15 Jan 2009 18:18:21 +0000 (18:18 +0000)]
Keyboard cursor support in Galaxies, by James H.

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

15 years agoKeyboard interface for Filling, from James H.
simon [Wed, 14 Jan 2009 20:44:25 +0000 (20:44 +0000)]
Keyboard interface for Filling, from James H.

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

15 years agoPatch from James H to fix some off-by-one errors in Guess's click
simon [Mon, 12 Jan 2009 20:30:12 +0000 (20:30 +0000)]
Patch from James H to fix some off-by-one errors in Guess's click
rectangle checking, preventing array bounds violation.

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

15 years agoPatch from James H which adds keyboard cursor support to Unequal,
simon [Mon, 12 Jan 2009 20:23:56 +0000 (20:23 +0000)]
Patch from James H which adds keyboard cursor support to Unequal,
and also updates the docs for both that and the Mines cursor support
in r8402.

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

15 years agoPatches from James H to add or improve arrow-key-driven cursors for
simon [Thu, 8 Jan 2009 18:28:32 +0000 (18:28 +0000)]
Patches from James H to add or improve arrow-key-driven cursors for
some puzzles. (Light Up's and Net's are merely polished a bit, but
Mines acquires a new one.)

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

15 years agoPatch from Lambros to make the Normal difficulty level easier, since
simon [Wed, 7 Jan 2009 23:07:11 +0000 (23:07 +0000)]
Patch from Lambros to make the Normal difficulty level easier, since
people have generally seemed to think Loopy is one of the more
difficult puzzles in the collection. There's a new level called
Tricky, between Normal and Hard, which is equivalent to the old
Normal.

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

15 years agoStandalone solver for Loopy. Bit half-hearted, since the solver
simon [Wed, 7 Jan 2009 21:55:21 +0000 (21:55 +0000)]
Standalone solver for Loopy. Bit half-hearted, since the solver
doesn't have diagnostics embedded and the ASCII formatter can't
print non-square puzzles anyway; but it can grade difficulty, which
is what I most immediately want it for.

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

15 years agoPatch from James H to enable a single monolithic binary to be built
simon [Tue, 6 Jan 2009 23:26:18 +0000 (23:26 +0000)]
Patch from James H to enable a single monolithic binary to be built
alongside the individual puzzle binaries, on Windows only. (MacOS
already has it, of course; Unix would require about as much work
again.)

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

15 years agoBring the unfinished .R files into line with the current conventions.
simon [Tue, 6 Jan 2009 23:21:42 +0000 (23:21 +0000)]
Bring the unfinished .R files into line with the current conventions.

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

15 years agoDon't ignore the return code of fwrite(). (Slight modification of a
simon [Fri, 12 Dec 2008 19:49:05 +0000 (19:49 +0000)]
Don't ignore the return code of fwrite(). (Slight modification of a
patch from Phil Bordelon.)

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

15 years agoAdd missing call to gtk_selection_clear_targets(), without which the
simon [Mon, 1 Dec 2008 23:04:17 +0000 (23:04 +0000)]
Add missing call to gtk_selection_clear_targets(), without which the
list of selection targets offered by GTK Puzzles grows an extra copy
of each of the three supported text formats every time the user
makes a selection!

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

15 years agoStand-alone command-line interface to the obfuscate_bitmap()
simon [Sat, 29 Nov 2008 13:51:36 +0000 (13:51 +0000)]
Stand-alone command-line interface to the obfuscate_bitmap()
function. Useful in conjunction with the new --save option to
generate lots of games, extract the aux strings from the game
generator, and de-obfuscate them in order to measure statistical
properties of their solutions.

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

15 years agoThe other day I found it useful for a (silly) special purpose to
simon [Sat, 29 Nov 2008 08:50:50 +0000 (08:50 +0000)]
The other day I found it useful for a (silly) special purpose to
generate a thousand saved-game files of randomly generated puzzles.
On the general principle that if I find it useful someone else
conceivably might too, add a --save option to the Unix puzzle
binaries, for use with --generate in much the same way as --print.

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

15 years agoFix parenthesis problem in Light Up solver. Should fix Debian bug
simon [Fri, 28 Nov 2008 19:33:40 +0000 (19:33 +0000)]
Fix parenthesis problem in Light Up solver. Should fix Debian bug
#505359.

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

15 years agoLet's have some more presets in here: 3x3 is much _too_ short and
simon [Fri, 28 Nov 2008 18:33:39 +0000 (18:33 +0000)]
Let's have some more presets in here: 3x3 is much _too_ short and
easy compared to 6x6.

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

15 years agoPatch from Lee Dowling to implement mouse control in Sokoban, along
simon [Sun, 16 Nov 2008 15:47:55 +0000 (15:47 +0000)]
Patch from Lee Dowling to implement mouse control in Sokoban, along
pretty much the same lines as Cube and Inertia.

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

15 years agoTake out some lurking "nullgame" holdovers from unfinished puzzle
simon [Sun, 16 Nov 2008 15:42:32 +0000 (15:42 +0000)]
Take out some lurking "nullgame" holdovers from unfinished puzzle
source files, in case they cause trouble. Spotted by Lee Dowling.

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

15 years agoPatches from Lee Dowling to make Light Up and Net use the
simon [Sun, 16 Nov 2008 15:37:58 +0000 (15:37 +0000)]
Patches from Lee Dowling to make Light Up and Net use the
CURSOR_SELECT2 button (to, respectively, toggle a "definitely not
light" dot and to rotate in the opposite direction from
CURSOR_SELECT).

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

15 years agoCouple of solving-related mid-end tweaks. Firstly, when we generate
simon [Sun, 16 Nov 2008 15:28:28 +0000 (15:28 +0000)]
Couple of solving-related mid-end tweaks. Firstly, when we generate
a game which comes with an aux string, we immediately self-test that
string by passing it to solve() and test by assertion that it
succeeded. So a bug in a back end which intermittently generates
malformed aux strings will be detected as soon as it occurs, instead
of only if the user happens to use the Solve operation on a
particular game in which it happened.

Secondly, Ctrl-S now (undocumentedly) triggers the Solve operation,
on the general principle that keyboard shortcuts tend to come in
handy, and on the specific principle that if you want to look at
lots of solved grids in quick succession (say, when observing their
general shape and nature to see if your generation algorithm was
good or not) it's handy to have a quick way of getting to them.

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

15 years agoCheck return values from fwrite when saving files.
simon [Tue, 4 Nov 2008 23:02:07 +0000 (23:02 +0000)]
Check return values from fwrite when saving files.

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

15 years agoPatch from Lambros to improve the generality of path-generation. In
simon [Tue, 4 Nov 2008 21:39:59 +0000 (21:39 +0000)]
Patch from Lambros to improve the generality of path-generation. In
particular, Great Hexagonal tilings previously had virtually every
(if not _actually_ every) hexagon on the inside of the path, and now
don't.

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

15 years agoPatch from Chris Boyle to prevent Solo's inter-block dividing lines
simon [Sun, 2 Nov 2008 14:29:41 +0000 (14:29 +0000)]
Patch from Chris Boyle to prevent Solo's inter-block dividing lines
from becoming indistinguishable from the intra-block ones at low
tile sizes.

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

15 years agoApply "103_fix-unequal-digit-h.diff" from the Debian package:
jacob [Sun, 5 Oct 2008 12:22:37 +0000 (12:22 +0000)]
Apply "103_fix-unequal-digit-h.diff" from the Debian package:
Unequal 18x18 or above was unplayable due to a clash with the undocumented
"H" (hint) key. Resolve the clash by making the hint function only fire
when no square is selected.

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

15 years agoRemove strange punctuation.
jacob [Sat, 4 Oct 2008 21:49:44 +0000 (21:49 +0000)]
Remove strange punctuation.

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

15 years agoCut-and-paste error which was preventing any drop-down list in the
simon [Fri, 19 Sep 2008 07:31:52 +0000 (07:31 +0000)]
Cut-and-paste error which was preventing any drop-down list in the
custom game configuration code from working in the Java applets.

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

15 years agoLambros points out that trying to generate a 3x3 Cairo Easy grid
simon [Thu, 18 Sep 2008 18:19:55 +0000 (18:19 +0000)]
Lambros points out that trying to generate a 3x3 Cairo Easy grid
spins forever, but observes that raising the limit to 4x4 across all
grid types is not good for the complex grids like great-hexagonal.
Introduce per-grid minimum sizes using mad macro trickery.

(In fact, for each grid type I've put in a minimum size which _both_
dimensions must equal or exceed, plus another minimum size which _at
least one_ must equal or exceed; that permits both 3x4 and 4x3 Cairo
while disallowing 3x3.)

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

15 years agoPatch from Lambros implementing error highlighting in Loopy.
simon [Thu, 18 Sep 2008 15:33:13 +0000 (15:33 +0000)]
Patch from Lambros implementing error highlighting in Loopy.

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

15 years agoYet another complete rewrite of Slant's loop detection during
simon [Wed, 17 Sep 2008 16:43:36 +0000 (16:43 +0000)]
Yet another complete rewrite of Slant's loop detection during
gameplay. Having tried methods based on using the slashes to define
a dsf on grid vertices, and also methods based on tracing round the
loops using conventional (non-dsf-based) graph theory, it occurred
to me the other day that there's a far simpler technique involving
connectivity. A loop is precisely that which causes the playing area
to become disconnected; so what we do now is to go through and build
a dsf describing connectedness of the _area_ of the grid rather than
the vertices. That divides the area into its maximal connected
components, and then we can trivially identify every edge that's
part of a loop by noticing that it separates two nonequivalent
pieces of space. The resulting algorithm is half the size of the old
one, and it's much easier to be confident of its correctness.

(Having said which, there will doubtless turn out to be an
embarrassing bug in it, but I haven't found it yet.)

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

15 years agoCosmetic: fix mismatch between game_compute_size() and game_redraw()
jacob [Tue, 16 Sep 2008 23:51:57 +0000 (23:51 +0000)]
Cosmetic: fix mismatch between game_compute_size() and game_redraw()
(was causing unwanted "drop-shadow" type effect).

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

15 years agoLambros provides this workaround for a compiler warning on his
simon [Sun, 14 Sep 2008 08:52:59 +0000 (08:52 +0000)]
Lambros provides this workaround for a compiler warning on his
Ubuntu system. I'm inclined to think the real problem is in his gtk
headers, but this is a harmless enough change to avoid hassle.

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

15 years agoTypo spotted by James H.
simon [Sat, 13 Sep 2008 19:21:53 +0000 (19:21 +0000)]
Typo spotted by James H.

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

15 years agoOops, left this out of r8178: having defined COMBINED everywhere in
simon [Sat, 13 Sep 2008 19:18:42 +0000 (19:18 +0000)]
Oops, left this out of r8178: having defined COMBINED everywhere in
the puzzles, we can now remove it from the OS X makefile section.

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

15 years agoChange to the handling of -DCOMBINED in the makefiles. Instead of
simon [Sat, 13 Sep 2008 19:17:26 +0000 (19:17 +0000)]
Change to the handling of -DCOMBINED in the makefiles. Instead of
defining it centrally per port, I think it's neater to define it for
each puzzle when adding that puzzle to the ALL list - because those
front ends which take -DCOMBINED are precisely those which use ALL.
In particular, this change opens up the possibility of compiling
both individual puzzles _and_ a combined monolith within the same
makefile.

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

15 years agoPatch from James H providing lots more paranoid casting. Also one
simon [Sat, 13 Sep 2008 18:29:20 +0000 (18:29 +0000)]
Patch from James H providing lots more paranoid casting. Also one
actual behaviour change: Untangle now permits dragging with the
right mouse button, which has exactly the same effect as it does
with the left. (Harmless on desktop platforms, but helpful when
"right-click" is achieved by press-and-hold; now the drag takes
place even if you hesitate first.)

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

15 years agoPatch from James H to centralise some generally useful cursor-
simon [Sat, 13 Sep 2008 18:26:53 +0000 (18:26 +0000)]
Patch from James H to centralise some generally useful cursor-
handling functionality into misc.c.

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

15 years agoSince the lack of this has caused portability issues in the past:
simon [Sat, 13 Sep 2008 18:25:19 +0000 (18:25 +0000)]
Since the lack of this has caused portability issues in the past:
add "-ansi -pedantic" to the main Unix makefile, and clean up a few
minor problems pointed out thereby.

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

15 years agoPatch from James H to make new-Loopy port more easily.
simon [Wed, 10 Sep 2008 21:44:23 +0000 (21:44 +0000)]
Patch from James H to make new-Loopy port more easily.

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

15 years agoHaving played new-Loopy a bit recently, I've had occasion to think a
simon [Sun, 7 Sep 2008 10:02:40 +0000 (10:02 +0000)]
Having played new-Loopy a bit recently, I've had occasion to think a
bit harder about advanced solver techniques. Expand the comment at
the top of the file.

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

15 years agoHow did I manage to check this in without actually trying to build
simon [Sun, 7 Sep 2008 08:35:52 +0000 (08:35 +0000)]
How did I manage to check this in without actually trying to build
on Windows at all?! Fix some departures from the C standard, mostly
declaring variables after a statement has already been issued in the
same block. MSVC is picky about this where gcc is forgiving, and TBH
I'd change the latter given the choice.

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

15 years agoNew Loopy save file, compatible with the new Loopy.
simon [Sat, 6 Sep 2008 21:24:21 +0000 (21:24 +0000)]
New Loopy save file, compatible with the new Loopy.

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

15 years agoNearly forgot: Lambros definitely deserves a place in the copyright
simon [Sat, 6 Sep 2008 17:38:43 +0000 (17:38 +0000)]
Nearly forgot: Lambros definitely deserves a place in the copyright
statement!

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

15 years agoDon't call changed_preset() until after we've initialised
simon [Sat, 6 Sep 2008 17:33:04 +0000 (17:33 +0000)]
Don't call changed_preset() until after we've initialised
fe->copy_menu_item.

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

15 years agoCompletely re-engineered version of Loopy, courtesy of Lambros
simon [Sat, 6 Sep 2008 15:19:47 +0000 (15:19 +0000)]
Completely re-engineered version of Loopy, courtesy of Lambros
Lambrou. Now capable of handling triangular and hexagonal grids as
well as square ones, and then a number of semiregular plane tilings
and duals of semiregular ones. In fact, most of the solver code
supports an _arbitrary_ planar graph (well, provided both the graph
and its dual have no self-edges), so it could easily be extended
further with only a little more effort.

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

15 years agoNew infrastructure feature. Games are now permitted to be
simon [Sat, 6 Sep 2008 09:27:56 +0000 (09:27 +0000)]
New infrastructure feature. Games are now permitted to be
_conditionally_ able to format the current puzzle as text to be sent
to the clipboard. For instance, if a game were to support playing on
a square grid and on other kinds of grid such as hexagonal, then it
might reasonably feel that only the former could be sensibly
rendered in ASCII art; so it can now arrange for the "Copy" menu
item to be greyed out depending on the game_params.

To do this I've introduced a new backend function
(can_format_as_text_now()), and renamed the existing static backend
field "can_format_as_text" to "can_format_as_text_ever". The latter
will cause compile errors for anyone maintaining a third-party front
end; if any such person is reading this, I apologise to them for the
inconvenience, but I did do it deliberately so that they'd know to
update their front end.

As yet, no checked-in game actually uses this feature; all current
games can still either copy always or copy never.

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

15 years agoOh, and some more ignore properties, oops.
simon [Mon, 18 Aug 2008 18:01:35 +0000 (18:01 +0000)]
Oh, and some more ignore properties, oops.

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

15 years agoExtra ignore properties for the dual-architecture OS X build, which
simon [Mon, 18 Aug 2008 18:00:33 +0000 (18:00 +0000)]
Extra ignore properties for the dual-architecture OS X build, which
I've managed to go a fair while without realising the need for.

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

15 years agoCorrection from James H: sqrt(0) shouldn't occur any more than
simon [Sat, 5 Jul 2008 22:07:35 +0000 (22:07 +0000)]
Correction from James H: sqrt(0) shouldn't occur any more than
sqrt(1) should.

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

15 years agoMore operations and bug fixes from James H.
simon [Sat, 5 Jul 2008 15:40:43 +0000 (15:40 +0000)]
More operations and bug fixes from James H.

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

15 years agoRemove rogue diagnostic.
simon [Sat, 5 Jul 2008 13:32:28 +0000 (13:32 +0000)]
Remove rogue diagnostic.

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

15 years agoAdd a build version designation to the NestedVM build, after Jacob
simon [Sat, 5 Jul 2008 13:31:59 +0000 (13:31 +0000)]
Add a build version designation to the NestedVM build, after Jacob
pointed out that Help > About in the Java applets on my website
currently reports "Unidentified build".

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

15 years agoBuild the Java versions of the puzzles automatically as part of the
simon [Fri, 27 Jun 2008 17:28:32 +0000 (17:28 +0000)]
Build the Java versions of the puzzles automatically as part of the
build process. Also update the new-puzzle checklist to make sure I
set up and test the Java applet for any new game I add.

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

15 years agoHandle a <param name="game_id"> by passing it in to the C side as
simon [Thu, 26 Jun 2008 19:09:07 +0000 (19:09 +0000)]
Handle a <param name="game_id"> by passing it in to the C side as
argv[1], which in turn feeds it into the midend as a game ID. This
can of course take any of the forms supported by the native C
puzzles: a pure game parameter string, a params:description specific
game ID, or a params#seed random game ID.

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

15 years agoThe Java console keeps showing up error reports due to being asked
simon [Thu, 26 Jun 2008 19:07:44 +0000 (19:07 +0000)]
The Java console keeps showing up error reports due to being asked
to resize the puzzle to zero size. Ignore all such requests, in the
assumption that a more sensible resize will be along soon enough
(which does seem to happen, though I haven't debugged the NestedVM
front end hard enough to figure out why the bogus resizes happen in
the first place).

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

15 years agoJames H has helpfully provided yet more silly operators for the -A
simon [Tue, 24 Jun 2008 20:58:35 +0000 (20:58 +0000)]
James H has helpfully provided yet more silly operators for the -A
mode. I think some user-defined ruleset configuration options are
now required...

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

15 years agoAn option to enable a debugging mode for the BFS.
simon [Mon, 23 Jun 2008 17:34:56 +0000 (17:34 +0000)]
An option to enable a debugging mode for the BFS.

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

15 years agoMichael Schierl's patch to compile the puzzles as Java applets using
simon [Tue, 10 Jun 2008 20:35:17 +0000 (20:35 +0000)]
Michael Schierl's patch to compile the puzzles as Java applets using
NestedVM. Wow!

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

15 years agoJust noticed that the return value of midend_process_key() wasn't
simon [Tue, 10 Jun 2008 17:24:09 +0000 (17:24 +0000)]
Just noticed that the return value of midend_process_key() wasn't
documented.

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