687 Commits

Author SHA1 Message Date
93103eeca4 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.

[originally from svn r7974]
2008-04-07 15:56:42 +00:00
d2369aab62 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.

[originally from svn r7932]
2008-03-20 09:18:26 +00:00
202e023f59 I _think_, after some fairly random experimentation, that this ought
to fix the weird blacked-out text in the xvfb-built screenshots.

[originally from svn r7931]
2008-03-20 00:19:27 +00:00
7a3549db51 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.)

[originally from svn r7916]
2008-03-11 17:59:38 +00:00
ace2c7dafd 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.)

[originally from svn r7849]
2008-02-10 18:43:29 +00:00
9673a2a733 It's another new year.
[originally from svn r7848]
2008-02-10 17:12:49 +00:00
433e615006 Syntactic fixes by Zach Wily to make the OS X build work under 10.5.
[originally from svn r7836]
2008-01-15 18:04:13 +00:00
5b9a5aa4cb 64-bit cleanliness: we were already carefully using a uint32 type in
the SHA code, but it wasn't correctly defined!

[originally from svn r7817]
2007-12-15 21:09:45 +00:00
a603318eec A rigorous proof. Totally unimportant to the code, but I didn't want
to lose it :-)

[originally from svn r7703]
2007-08-25 17:46:13 +00:00
f228c5ef00 Fix an inaccurate comment.
[originally from svn r7702]
2007-08-25 15:50:33 +00:00
cb0901306d 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.

[originally from svn r7701]
2007-08-25 15:32:41 +00:00
c746f6d0e3 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).

[originally from svn r7700]
2007-08-25 14:10:49 +00:00
4ff90bd47f Ahem. Finishing writing the comment _before_ checkin is generally sensible.
[originally from svn r7694]
2007-08-18 13:32:56 +00:00
4c1e3ca7cb 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.

[originally from svn r7693]
2007-08-18 13:30:13 +00:00
333d57bf6e Better test-mode diagnostics.
[originally from svn r7691]
2007-08-18 11:19:29 +00:00
cc54c09413 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'.

[originally from svn r7690]
2007-08-18 10:07:29 +00:00
2842817eda 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.

[originally from svn r7656]
2007-07-31 17:04:20 +00:00
519b7de973 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.

[originally from svn r7636]
2007-07-05 18:57:50 +00:00
d9c4a9b659 Optimiser placation.
[originally from svn r7625]
2007-06-29 09:45:44 +00:00
1c42aec234 Updates and improvements from Jonas Koelker.
[originally from svn r7601]
2007-05-20 14:28:48 +00:00
399ac356bd Left puzzles.rc2 out of the tarball. Oops.
[originally from svn r7600]
2007-05-19 06:16:24 +00:00
e6116563bd More forgiving selection of dragging targets.
[originally from svn r7574]
2007-05-12 13:13:39 +00:00
be8f9c5284 Graphics tweak: make the top-right and bottom-left corners of
everything look nicer.

[originally from svn r7573]
2007-05-12 11:51:39 +00:00
143081d296 In-game user interface to the solver.
[originally from svn r7572]
2007-05-12 10:26:22 +00:00
5b8b855376 Fix tiny memory leak if you pressed Solve while part way through an
existing solution path.

[originally from svn r7571]
2007-05-12 08:26:58 +00:00
81e3a145bf Remove the check for disconnected pieces; it's over-general and
triggers on a perfectly connected piece shaped like an inverted T.

[originally from svn r7570]
2007-05-12 08:14:37 +00:00
05a0cf0684 noicon.rc was missing from the Unix source archive, which caused a
re-run of mkfiles.pl to fail.

[originally from svn r7567]
2007-05-10 11:10:14 +00:00
81ccb144eb Stand-alone slidesolver.
[originally from svn r7558]
2007-05-07 19:36:19 +00:00
f7d2c94138 Add an optional move limit during game generation.
[originally from svn r7554]
2007-05-07 19:08:52 +00:00
2d30316b76 Slight solver speedup by tracking more carefully which block merges
we've already tried, and not trying them again.

[originally from svn r7553]
2007-05-07 17:51:37 +00:00
ab80d0b7fd Add a new misc.c function needed by Slide's colour setup.
[originally from svn r7552]
2007-05-07 17:50:14 +00:00
7fce4f57c2 Close-to-finished auto-generating implementation of Klotski.
[originally from svn r7547]
2007-05-07 14:49:05 +00:00
6da8849110 I still haven't managed to get the WinCE port building via bob, but
I should at least check in what I've got.

[originally from svn r7542]
2007-05-06 09:54:34 +00:00
61395a5141 Ensure the shuffling process never produces an already-solved grid.
[originally from svn r7446]
2007-04-04 19:12:17 +00:00
f6a7276495 In the Windows frontend, stop tab navigation from activating buttons.
[originally from svn r7436]
2007-03-31 16:00:50 +00:00
9885a86a27 Er, and now do that _without_ introducing further segfaults.
[originally from svn r7409]
2007-03-26 10:24:25 +00:00
0589681d9d Stop failing assertions when we encounter an insoluble puzzle.
[originally from svn r7408]
2007-03-26 10:20:51 +00:00
5fb108db00 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.

[originally from svn r7407]
2007-03-23 18:08:21 +00:00
02cd67ecb6 Disallow clicks between squares.
[originally from svn r7400]
2007-03-16 13:32:43 +00:00
67b37596c2 r7364 failed to expand a malloc to match the larger data being put
in it.

[originally from svn r7387]
[r7364 == 39d299f579da3e91308d63acc78c68ab74666989]
2007-03-11 10:39:44 +00:00
f7e755628b 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.

[originally from svn r7386]
2007-03-11 10:12:45 +00:00
4212ef4bd2 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.

[originally from svn r7385]
2007-03-11 10:04:00 +00:00
d0a824540b Since we've changed the semantics of the `expand' argument to midend_size(),
change the name. Also document the new semantics.

[originally from svn r7369]
2007-03-03 23:43:22 +00:00
8b21ddc396 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.)

[originally from svn r7368]
2007-03-03 23:17:35 +00:00
c1b0c1d091 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.

[originally from svn r7367]
2007-03-03 22:39:17 +00:00
d916cd7ff9 Refactoring patch from Ben Hutchings: move all the Gtk resize code into one
place. (From Debian bug#379452)

[originally from svn r7366]
2007-03-03 22:05:05 +00:00
39d299f579 Patch from James H to provide resizability on Windows.
[originally from svn r7364]
2007-03-03 17:36:44 +00:00
8d710851de Minor cleanups (mostly \ns in diagnostic printfs) from James H.
[originally from svn r7363]
2007-03-03 17:25:13 +00:00
587d105799 My favourite kind of patch, from James H: one which decreases the
amount of code. James has ripped out the solver's version of
check_complete(), in favour of using the one I wrote for the
game-playing UI. My one checks connectedness, which means that the
solver will now not believe non-solutions to puzzles where
connectedness becomes a difficult issue. Examples of game IDs which
are now solved correctly but were previously not are 5x3:ubb and
7x7:ajfzmfqgtdzgt.

[originally from svn r7362]
2007-03-03 17:15:25 +00:00
6a361ce734 About time I got round to documenting the new
REQUIRE_{RBUTTON,NUMPAD} flags.

[originally from svn r7356]
2007-03-03 09:41:51 +00:00