sgt/puzzles
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

15 years agoNew -A mode permitting even madder operators, and also -m to try to
simon [Mon, 9 Jun 2008 18:28:03 +0000 (18:28 +0000)]
New -A mode permitting even madder operators, and also -m to try to
print all possible paths to a value. The latter has a lot of
de-duplication left to be done, due to multiple evaluation orders.

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

16 years agoShamelessly pander to compilers whose data flow warning systems
simon [Mon, 14 Apr 2008 11:32:06 +0000 (11:32 +0000)]
Shamelessly pander to compilers whose data flow warning systems
insist that a variable should be initialised in all branches of an
if, instead of just all the non-assertion-failing ones.

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

16 years agoNow that we're highlighting the currently selected preset in the
simon [Thu, 10 Apr 2008 11:11:33 +0000 (11:11 +0000)]
Now that we're highlighting the currently selected preset in the
Type menu, it looks faintly silly that Fifteen doesn't have any
presets other than Custom: you open a Fifteen window in its default
state, and the Type menu appears to be telling you it has a custom
size! Fixed by adding a preset for the default parameters.

I'd quite like to fix this properly by revamping the presets
mechanism in a way that _enforces_ that there must always be a
preset which matches the default parameters, but that's more fiddly
than it sounds. For the moment, this change fixes the only
externally visible infelicity in the current game set.

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

16 years agoImplement tick marks in the Type menu on Windows. Now all my front
simon [Wed, 9 Apr 2008 14:57:20 +0000 (14:57 +0000)]
Implement tick marks in the Type menu on Windows. Now all my front
ends have got them.

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

16 years agoImplement tick marks in the Type menu on OS X.
simon [Wed, 9 Apr 2008 14:36:08 +0000 (14:36 +0000)]
Implement tick marks in the Type menu on OS X.

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

16 years agoNew feature in midend.c which allows us to ask for the number of the
simon [Tue, 8 Apr 2008 16:25:39 +0000 (16:25 +0000)]
New feature in midend.c which allows us to ask for the number of the
currently selected preset, if any. I've used this in the GTK front
end to have the Type menu mark the currently selected menu item.
(After considerable beating of GTK with sticks, I might add. Grr.)
Currently the same UI feature is not yet supported on Windows or
MacOS, but I hope to do those too at some point if it's feasible.

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

16 years agoHaving got Jigsaw mode generation working at reasonable speed, we
simon [Tue, 8 Apr 2008 10:30:18 +0000 (10:30 +0000)]
Having got Jigsaw mode generation working at reasonable speed, we
can now productise it.

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

16 years agoImprovements to filled-grid generation. Introduced a cunning idea
simon [Tue, 8 Apr 2008 09:36:33 +0000 (09:36 +0000)]
Improvements to filled-grid generation. Introduced a cunning idea
suggested by IWJ last night: grid generation can immediately choose
an entire grid row randomly, since all that's doing is nailing down
the names of the numbers, and that gets the whole thing started more
efficiently. But the main difference is that now grid generation is
given only area^2 steps to come up with a filled grid, and then cut
off unceremoniously, causing grid generation to fail and be retried
from scratch. This seems to prevent hangups on jigsaw layouts that
admit few useful solutions, by changing layout constantly. 9j
puzzles now generate at a sensible rate, and as an added bonus so do
5x5 normal puzzles, which they never used to.

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

16 years agoAhem. Apparently forgot to compile-test after that one last tiny
simon [Mon, 7 Apr 2008 17:16:08 +0000 (17:16 +0000)]
Ahem. Apparently forgot to compile-test after that one last tiny
change.

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

16 years agoRevise the printing colour framework so that we can explicitly
simon [Mon, 7 Apr 2008 17:13:29 +0000 (17:13 +0000)]
Revise the printing colour framework so that we can explicitly
request either of hatching or halftoning, and also choose which to
supply as a fallback when printing in colour.

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

16 years agoPedantic tweaks to allow successful compilation on Windows. (gcc
simon [Mon, 7 Apr 2008 17:12:21 +0000 (17:12 +0000)]
Pedantic tweaks to allow successful compilation on Windows. (gcc
failed to point out a declaration after a statement, and gcc's
linker was clever enough to optimise the call to divvy_rectangle()
out of solosolver so that I didn't have to include divvy.c in that.)

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

16 years agoSubstantial reworking of Solo so that it implements both Sudoku-X
simon [Mon, 7 Apr 2008 15:56:42 +0000 (15:56 +0000)]
Substantial reworking of Solo so that it implements both Sudoku-X
(require both main diagonals to have one of every digit in addition
to all the usual constraints) and Jigsaw Sudoku (replace the array
of rectangular sub-blocks with the sub-blocks being random
polyominoes). To implement the latter, I've moved my `divvy.c'
library routine out of the `unfinished' subdirectory.

Jigsaw mode is currently an undocumented feature: you enable it by
setting the rows parameter to 1 (and the columns parameter to your
desired grid size, which unlike normal Sudoku can be anything you
like including a prime number). The reason it's undocumented is
because generation times are not yet reliably short: sometimes
generating a jigsaw-type puzzle can hang for hours and still get
nowhere. (The algorithm should terminate in principle, but not in
any time you're prepared to wait.) I _think_ I know how to solve
this, but have yet to try it. Until then, jigsaw mode will remain a
hidden feature.

Printing of X-type puzzles is also substandard at present, because
the current print-colour API replaces the desired light shading of
the X-cells with heavy diagonal hatching. I plan to adjust the API
imminently to address this.

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

16 years agoHmm. Telling xvfb to default to a TrueColor visual did help, in that
simon [Thu, 20 Mar 2008 09:18:26 +0000 (09:18 +0000)]
Hmm. Telling xvfb to default to a TrueColor visual did help, in that
it got rid of the bogus backgrounds on all the text; but on the
other hand it mysteriously caused all the images to become black and
white! Serves me right for testing with Bridges which was B&W to
start with. Instead, we'll just tell xvfb to use a 24-bit display
and let it sort out the visuals for itself; that seems to work better.

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

16 years agoI _think_, after some fairly random experimentation, that this ought
simon [Thu, 20 Mar 2008 00:19:27 +0000 (00:19 +0000)]
I _think_, after some fairly random experimentation, that this ought
to fix the weird blacked-out text in the xvfb-built screenshots.

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

16 years agoUpdate the OS X Puzzles makefile so that it builds on Leopard and
simon [Tue, 11 Mar 2008 17:59:38 +0000 (17:59 +0000)]
Update the OS X Puzzles makefile so that it builds on Leopard and
generates PPC/Intel dual-architecture binaries.

This turns out not to be too painful: you compile and link your
programs using `gcc -arch ppc' or `gcc -arch i386', then you use a
command of the form `lipo -create ppc-binary i386-binary -output
binary' to construct a universal binary. It works equally well on
command-line standalone executable files and the executables within
application directories. Also added the -mmacosx-version-min option,
since otherwise the OS X build tools appear to default to building
binaries which will crash (without anything resembling a
comprehensible error message) on any earlier release.

The handling of version.o in this checkin is somewhat grotty. I'd
prefer a method more cleverly intertwingled with mkfiles.pl so I
didn't have to maintain the OS X architecture list in both
mkfiles.pl and Recipe. (Not that I anticipate Apple switching
architectures again in the immediate future, but it's the principle
of the thing.)

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

16 years agoUI change to Filling: allow multiple squares to be set at once.
jacob [Sun, 10 Feb 2008 18:43:29 +0000 (18:43 +0000)]
UI change to Filling: allow multiple squares to be set at once.

(This change adds a new possibility to the save format, such that new save
files won't necessarily be loadable by old binaries. I think that's acceptable
-- it's certainly happened before -- but I couldn't find anything in the
developer docs explicitly blessing it.)

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

16 years agoIt's another new year.
jacob [Sun, 10 Feb 2008 17:12:49 +0000 (17:12 +0000)]
It's another new year.

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

16 years agoSyntactic fixes by Zach Wily to make the OS X build work under 10.5.
simon [Tue, 15 Jan 2008 18:04:13 +0000 (18:04 +0000)]
Syntactic fixes by Zach Wily to make the OS X build work under 10.5.

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

16 years ago64-bit cleanliness: we were already carefully using a uint32 type in
simon [Sat, 15 Dec 2007 21:09:45 +0000 (21:09 +0000)]
64-bit cleanliness: we were already carefully using a uint32 type in
the SHA code, but it wasn't correctly defined!

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

16 years agoA rigorous proof. Totally unimportant to the code, but I didn't want
simon [Sat, 25 Aug 2007 17:46:13 +0000 (17:46 +0000)]
A rigorous proof. Totally unimportant to the code, but I didn't want
to lose it :-)

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

16 years agoFix an inaccurate comment.
simon [Sat, 25 Aug 2007 15:50:33 +0000 (15:50 +0000)]
Fix an inaccurate comment.

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

16 years agoI've just realised that my deliberate avoidance of non-simply
simon [Sat, 25 Aug 2007 15:32:41 +0000 (15:32 +0000)]
I've just realised that my deliberate avoidance of non-simply
connected polyominoes actually causes a loss of generality for
sufficiently large k. I hadn't previously noticed, because you need
k to be (I think) at least 23 and none of my potential applications
require anything nearly that large. Add some discussion of this.

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

16 years agoCommit my work so far on a generator for Nikoli's `Block Puzzle'. It
simon [Sat, 25 Aug 2007 14:10:49 +0000 (14:10 +0000)]
Commit my work so far on a generator for Nikoli's `Block Puzzle'. It
works, but it's slow, and the puzzles are currently at a relatively
low level of difficulty. Also this is a generator only: no UI yet
(because I'm waiting to see if I can make the generator practical
before bothering to write the rest).

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

16 years agoAhem. Finishing writing the comment _before_ checkin is generally sensible.
simon [Sat, 18 Aug 2007 13:32:56 +0000 (13:32 +0000)]
Ahem. Finishing writing the comment _before_ checkin is generally sensible.

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

16 years agoAllow a 1-omino to be completely destroyed and recreated in an
simon [Sat, 18 Aug 2007 13:30:13 +0000 (13:30 +0000)]
Allow a 1-omino to be completely destroyed and recreated in an
arbitrary unclaimed square. This cures the most common cause of
generation failures (covering a large area in dominoes was the most
difficult case, and would fail even if the large area was 1xn!); the
failure rate is now sufficiently low under all circumstances I've
found that I'm willing to just loop until I get a success.

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

16 years agoBetter test-mode diagnostics.
simon [Sat, 18 Aug 2007 11:19:29 +0000 (11:19 +0000)]
Better test-mode diagnostics.

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

16 years agoA piece of library code which constructs a random division of a
simon [Sat, 18 Aug 2007 10:07:29 +0000 (10:07 +0000)]
A piece of library code which constructs a random division of a
rectangle into equally sized ominoes. I have a couple of potential
applications for this, but none I've actually implemented yet, so
for the moment it's living in `unfinished'.

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

16 years agoExperimental UI tweak enabled by a hacky environment variable:
simon [Tue, 31 Jul 2007 17:04:20 +0000 (17:04 +0000)]
Experimental UI tweak enabled by a hacky environment variable:
suppress the display of `this square can't be a light' blobs in a
lit square, on the grounds that we already know _lit_ squares can't
be lights. This makes the solved game look cleaner (I've always
thought the detritus of blobs on some but not all non-light squares
looked messy), but on the other hand it's slightly jarring during
play. So I'm checking it in, but as a configurable option which is
off by default.

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

16 years agoA user points out that Loopy's solver relies on elements of the
simon [Thu, 5 Jul 2007 18:57:50 +0000 (18:57 +0000)]
A user points out that Loopy's solver relies on elements of the
`clues' array being able to be -1, so we must explicitly declare it
as `signed char' or it will break on platforms whose default char is
unsigned.

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

16 years agoOptimiser placation.
simon [Fri, 29 Jun 2007 09:45:44 +0000 (09:45 +0000)]
Optimiser placation.

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

17 years agoUpdates and improvements from Jonas Koelker.
simon [Sun, 20 May 2007 14:28:48 +0000 (14:28 +0000)]
Updates and improvements from Jonas Koelker.

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

17 years agoLeft puzzles.rc2 out of the tarball. Oops.
simon [Sat, 19 May 2007 06:16:24 +0000 (06:16 +0000)]
Left puzzles.rc2 out of the tarball. Oops.

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

17 years agoMore forgiving selection of dragging targets.
simon [Sat, 12 May 2007 13:13:39 +0000 (13:13 +0000)]
More forgiving selection of dragging targets.

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

17 years agoGraphics tweak: make the top-right and bottom-left corners of
simon [Sat, 12 May 2007 11:51:39 +0000 (11:51 +0000)]
Graphics tweak: make the top-right and bottom-left corners of
everything look nicer.

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

17 years agoIn-game user interface to the solver.
simon [Sat, 12 May 2007 10:26:22 +0000 (10:26 +0000)]
In-game user interface to the solver.

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

17 years agoFix tiny memory leak if you pressed Solve while part way through an
simon [Sat, 12 May 2007 08:26:58 +0000 (08:26 +0000)]
Fix tiny memory leak if you pressed Solve while part way through an
existing solution path.

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

17 years agoRemove the check for disconnected pieces; it's over-general and
simon [Sat, 12 May 2007 08:14:37 +0000 (08:14 +0000)]
Remove the check for disconnected pieces; it's over-general and
triggers on a perfectly connected piece shaped like an inverted T.

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

17 years agonoicon.rc was missing from the Unix source archive, which caused a
simon [Thu, 10 May 2007 11:10:14 +0000 (11:10 +0000)]
noicon.rc was missing from the Unix source archive, which caused a
re-run of mkfiles.pl to fail.

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

17 years agoStand-alone slidesolver.
simon [Mon, 7 May 2007 19:36:19 +0000 (19:36 +0000)]
Stand-alone slidesolver.

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

17 years agoAdd an optional move limit during game generation.
simon [Mon, 7 May 2007 19:08:52 +0000 (19:08 +0000)]
Add an optional move limit during game generation.

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

17 years agoSlight solver speedup by tracking more carefully which block merges
simon [Mon, 7 May 2007 17:51:37 +0000 (17:51 +0000)]
Slight solver speedup by tracking more carefully which block merges
we've already tried, and not trying them again.

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

17 years agoAdd a new misc.c function needed by Slide's colour setup.
simon [Mon, 7 May 2007 17:50:14 +0000 (17:50 +0000)]
Add a new misc.c function needed by Slide's colour setup.

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

17 years agoClose-to-finished auto-generating implementation of Klotski.
simon [Mon, 7 May 2007 14:49:05 +0000 (14:49 +0000)]
Close-to-finished auto-generating implementation of Klotski.

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

17 years agoI still haven't managed to get the WinCE port building via bob, but
simon [Sun, 6 May 2007 09:54:34 +0000 (09:54 +0000)]
I still haven't managed to get the WinCE port building via bob, but
I should at least check in what I've got.

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

17 years agoEnsure the shuffling process never produces an already-solved grid.
simon [Wed, 4 Apr 2007 19:12:17 +0000 (19:12 +0000)]
Ensure the shuffling process never produces an already-solved grid.

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

17 years agoIn the Windows frontend, stop tab navigation from activating buttons.
jacob [Sat, 31 Mar 2007 16:00:50 +0000 (16:00 +0000)]
In the Windows frontend, stop tab navigation from activating buttons.

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

17 years agoEr, and now do that _without_ introducing further segfaults.
simon [Mon, 26 Mar 2007 10:24:25 +0000 (10:24 +0000)]
Er, and now do that _without_ introducing further segfaults.

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

17 years agoStop failing assertions when we encounter an insoluble puzzle.
simon [Mon, 26 Mar 2007 10:20:51 +0000 (10:20 +0000)]
Stop failing assertions when we encounter an insoluble puzzle.

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

17 years agoKyle Brazell points out that the completion checker considers a
simon [Fri, 23 Mar 2007 18:08:21 +0000 (18:08 +0000)]
Kyle Brazell points out that the completion checker considers a
region valid if it has _a_ dot at its centre of symmetry, even if
that dot isn't actually within the region in question.

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

17 years agoDisallow clicks between squares.
jacob [Fri, 16 Mar 2007 13:32:43 +0000 (13:32 +0000)]
Disallow clicks between squares.

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

17 years agor7364 failed to expand a malloc to match the larger data being put
simon [Sun, 11 Mar 2007 10:39:44 +0000 (10:39 +0000)]
r7364 failed to expand a malloc to match the larger data being put
in it.

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

17 years agoGary Wong observes that solo's decode_params() is overenthusiastic
simon [Sun, 11 Mar 2007 10:12:45 +0000 (10:12 +0000)]
Gary Wong observes that solo's decode_params() is overenthusiastic
about eating the letter `d' (for `diagonal') when it appears in a
symmtery description: it should only be used after `m', because
mirror symmetry is the only type that can be diagonal. This was
causing parsing of the parameter description `3x3adu' to produce the
wrong answer: the d would be swallowed, then the u ignored for being
incomprehensible, and you'd get default Trivial difficulty.

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

17 years agoGary Wong points out that solosolver's verbose output is
simon [Sun, 11 Mar 2007 10:04:00 +0000 (10:04 +0000)]
Gary Wong points out that solosolver's verbose output is
inconsistent in whether it numbers rows and columns from zero or
from one. Standardise on one.

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

17 years agoSince we've changed the semantics of the `expand' argument to midend_size(),
jacob [Sat, 3 Mar 2007 23:43:22 +0000 (23:43 +0000)]
Since we've changed the semantics of the `expand' argument to midend_size(),
change the name. Also document the new semantics.

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

17 years agoPatch from Ben Hutchings to allow user-initiated tilesize changes to persist
jacob [Sat, 3 Mar 2007 23:17:35 +0000 (23:17 +0000)]
Patch from Ben Hutchings to allow user-initiated tilesize changes to persist
across changes in game parameters (e.g., changing difficulty without changing
size). This also has the effect of preserving the user-selected tilesize if the
grid size is changed. (From Debian bug#379452.)

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

17 years agoBen Hutchings' patch to allow Gtk windows to be shrunk as well as grown
jacob [Sat, 3 Mar 2007 22:39:17 +0000 (22:39 +0000)]
Ben Hutchings' patch to allow Gtk windows to be shrunk as well as grown
(from Debian bug#379452).
Tested on Gtk 2. I've been unable to find a Gtk+-1.2 installation on which
Puzzles compiles, so not tested there.

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

17 years agoRefactoring patch from Ben Hutchings: move all the Gtk resize code into one
jacob [Sat, 3 Mar 2007 22:05:05 +0000 (22:05 +0000)]
Refactoring patch from Ben Hutchings: move all the Gtk resize code into one
place. (From Debian bug#379452)

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