982 Commits

Author SHA1 Message Date
a35c660284 Patch from Chris Boyle to prevent Solo's inter-block dividing lines
from becoming indistinguishable from the intra-block ones at low
tile sizes.

[originally from svn r8259]
2008-11-02 14:29:41 +00:00
808495cb41 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.

[originally from svn r8200]
2008-10-05 12:22:37 +00:00
736da74eba Remove strange punctuation.
[originally from svn r8199]
2008-10-04 21:49:44 +00:00
8ad01fc6e7 Cut-and-paste error which was preventing any drop-down list in the
custom game configuration code from working in the Java applets.

[originally from svn r8192]
2008-09-19 07:31:52 +00:00
734dc80c53 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.)

[originally from svn r8191]
2008-09-18 18:19:55 +00:00
ef6166e198 Patch from Lambros implementing error highlighting in Loopy.
[originally from svn r8190]
2008-09-18 15:33:13 +00:00
55f9540179 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.)

[originally from svn r8187]
2008-09-17 16:43:36 +00:00
4cfec3765a Cosmetic: fix mismatch between game_compute_size() and game_redraw()
(was causing unwanted "drop-shadow" type effect).

[originally from svn r8186]
2008-09-16 23:51:57 +00:00
ba2a002c02 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.

[originally from svn r8181]
2008-09-14 08:52:59 +00:00
0819e8ec76 Typo spotted by James H.
[originally from svn r8180]
2008-09-13 19:21:53 +00:00
961f3d12b7 Oops, left this out of r8178: having defined COMBINED everywhere in
the puzzles, we can now remove it from the OS X makefile section.

[originally from svn r8179]
[r8178 == 43eafe1fdf356c0c1c88936ffa79c83291973b5d]
2008-09-13 19:18:42 +00:00
43eafe1fdf 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.

[originally from svn r8178]
2008-09-13 19:17:26 +00:00
1d661ec46b 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.)

[originally from svn r8177]
2008-09-13 18:29:20 +00:00
5ead207060 Patch from James H to centralise some generally useful cursor-
handling functionality into misc.c.

[originally from svn r8176]
2008-09-13 18:26:53 +00:00
fe1b91ac49 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.

[originally from svn r8175]
2008-09-13 18:25:19 +00:00
acf5c55d35 Patch from James H to make new-Loopy port more easily.
[originally from svn r8174]
2008-09-10 21:44:23 +00:00
018fa4053d 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.

[originally from svn r8167]
2008-09-07 10:02:40 +00:00
4033458aff 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.

[originally from svn r8166]
2008-09-07 08:35:52 +00:00
f7ab0a4996 New Loopy save file, compatible with the new Loopy.
[originally from svn r8165]
2008-09-06 21:24:21 +00:00
53bcfc7aea Nearly forgot: Lambros definitely deserves a place in the copyright
statement!

[originally from svn r8164]
2008-09-06 17:38:43 +00:00
ca20d86a06 Don't call changed_preset() until after we've initialised
fe->copy_menu_item.

[originally from svn r8163]
2008-09-06 17:33:04 +00:00
f38b711c73 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.

[originally from svn r8162]
2008-09-06 15:19:47 +00:00
a7431c0b7c 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.

[originally from svn r8161]
2008-09-06 09:27:56 +00:00
c6b1d4472b Correction from James H: sqrt(0) shouldn't occur any more than
sqrt(1) should.

[originally from svn r8108]
2008-07-05 22:07:35 +00:00
4322b90cbb More operations and bug fixes from James H.
[originally from svn r8107]
2008-07-05 15:40:43 +00:00
71807719f6 Remove rogue diagnostic.
[originally from svn r8106]
2008-07-05 13:32:28 +00:00
8104b2c35d 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".

[originally from svn r8105]
2008-07-05 13:31:59 +00:00
c115e9f5c8 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.

[originally from svn r8096]
2008-06-27 17:28:32 +00:00
0c88256a22 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.

[originally from svn r8095]
2008-06-26 19:09:07 +00:00
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