703 Commits

Author SHA1 Message Date
82b6a6fd39 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).

[originally from svn r8094]
2008-06-26 19:07:44 +00:00
1df94d233a James H has helpfully provided yet more silly operators for the -A
mode. I think some user-defined ruleset configuration options are
now required...

[originally from svn r8092]
2008-06-24 20:58:35 +00:00
49a077728f An option to enable a debugging mode for the BFS.
[originally from svn r8091]
2008-06-23 17:34:56 +00:00
dd85394bf6 Michael Schierl's patch to compile the puzzles as Java applets using
NestedVM. Wow!

[originally from svn r8064]
2008-06-10 20:35:17 +00:00
2066ddabd6 Just noticed that the return value of midend_process_key() wasn't
documented.

[originally from svn r8062]
2008-06-10 17:24:09 +00:00
3633fec8ae 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.

[originally from svn r8061]
2008-06-09 18:28:03 +00:00
83121fb826 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.

[originally from svn r7989]
2008-04-14 11:32:06 +00:00
4bd99ecae9 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.

[originally from svn r7983]
2008-04-10 11:11:33 +00:00
19172c4a30 Implement tick marks in the Type menu on Windows. Now all my front
ends have got them.

[originally from svn r7982]
2008-04-09 14:57:20 +00:00
810814823f Implement tick marks in the Type menu on OS X.
[originally from svn r7981]
2008-04-09 14:36:08 +00:00
ae6c738127 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.

[originally from svn r7980]
2008-04-08 16:25:39 +00:00
ea13d39a17 Having got Jigsaw mode generation working at reasonable speed, we
can now productise it.

[originally from svn r7979]
2008-04-08 10:30:18 +00:00
c8a843ee62 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.

[originally from svn r7978]
2008-04-08 09:36:33 +00:00
771532fe7f Ahem. Apparently forgot to compile-test after that one last tiny
change.

[originally from svn r7977]
2008-04-07 17:16:08 +00:00
0564211167 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.

[originally from svn r7976]
2008-04-07 17:13:29 +00:00
30da25262d 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.)

[originally from svn r7975]
2008-04-07 17:12:21 +00:00
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