------------------------------------------------------------------------
r9794 | simon | 2013-03-31 15:50:46 +0400 (, 31  2013) | 9 lines

Make sure the right element of the game-type dropdown starts off
selected. Previously we were leaving the first element on the list
selected, which is _usually_ right, but not right for Slant.

In the process of doing this, I've also reorganised to fix a crash
which shows up with non-configurable games (admittedly currently only
Nullgame :-) when we still try to call js_select_preset in spite of
not having any preset options to select.

------------------------------------------------------------------------
r9793 | simon | 2013-03-31 13:58:52 +0400 (, 31  2013) | 4 lines

Introduce a mechanism by which calls to midend_supersede_game_desc()
can trigger a call to a front end notification function. Use this to
update the game ID permalink when Mines supersedes its game ID.

------------------------------------------------------------------------
r9792 | simon | 2013-03-31 13:58:50 +0400 (, 31  2013) | 2 lines

Reinstate a missing semicolon.

------------------------------------------------------------------------
r9791 | simon | 2013-03-31 13:58:48 +0400 (, 31  2013) | 6 lines

Oops. I consistently misspelled my desired lineCap and lineJoin values
as "1" rather than "round". Must have had my Postscript brain in,
and/or been confused by lineWidth = "1" just beforehand. This fixes a
display glitch in Towers, where there's a tiny spike at the top left
corner of each tower due to a very sharp mitred line join.

------------------------------------------------------------------------
r9790 | simon | 2013-03-31 13:58:47 +0400 (, 31  2013) | 5 lines

Fix a crash when changing presets in Inertia. Turns out that my
Javascript-side blitter creation function had forgotten to return the
new blitter's id, so the C code was still trying to use blitter #0
after it had been thrown away and replaced.

------------------------------------------------------------------------
r9789 | simon | 2013-03-31 13:58:47 +0400 (, 31  2013) | 3 lines

Don't forget to restore the correct selection in the dropdown list if
the user cancels a configuration dialog.

------------------------------------------------------------------------
r9788 | simon | 2013-03-31 13:58:46 +0400 (, 31  2013) | 9 lines

Apply a bodge to arrange that if the user selects Custom from the game
type dropdown, we still get an 'onchange' event if they select it a
second time. Normally this wouldn't happen, because onchange means
what it says and we only get it if a _different_ element is selected.

My solution is to create two list items called Custom, set one of them
as display:none to stop it showing up when the list is dropped down,
and to select it after the configuration box closes.

------------------------------------------------------------------------
r9787 | simon | 2013-03-31 13:58:45 +0400 (, 31  2013) | 3 lines

Stop using the dangerously unescaped 'innerHTML' for <option>
contents; use document.createTextNode like I do everywhere else.

------------------------------------------------------------------------
r9786 | simon | 2013-03-31 12:55:21 +0400 (, 31  2013) | 2 lines

Forgot to make the web-page-building scripts executable.

------------------------------------------------------------------------
r9781 | simon | 2013-03-31 00:16:21 +0400 (, 31  2013) | 5 lines

New front end! To complement the webification of my puzzles via Java
applets, here's an alternative webification in Javascript, using
Emscripten in asm.js mode (so that as browsers incorporate asm.js
optimisation, the game generation should run really fast).

------------------------------------------------------------------------
r9780 | simon | 2013-03-31 00:04:10 +0400 (, 31  2013) | 17 lines

Introduce a mechanism in this source tree for building the container
web pages for the Java applets. Previously, those have all been
maintained by hand in my website's svn area, which is a bit silly. Now
we have a file per puzzle in the 'html' subdirectory which contains
the puzzle's name, one or two attributes, and the instructions snippet
to go below the puzzle applet; and then there's a Perl script that
builds all the real web pages out of that by adding in the parts
common across all files: the header, footer, and middle fragment with
the <applet> tag and resizing bits and pieces.

One piece _not_ checked in here is the footer text specific to my
hosting at chiark, which I think does still belong in the www area. So
Buildscr doesn't actually build the web pages; it just delivers the
bits and pieces by which my nightly snapshot script will be able to
run the program that _does_ build them, passing that footer as an
extra argument.

------------------------------------------------------------------------
r9779 | simon | 2013-03-30 22:03:15 +0400 (, 30  2013) | 4 lines

Edit the paragraph in the midend_deserialise() docs which I forgot to
fix in r9777 when I added documentation of the function it wistfully
imagined might one day exist.

------------------------------------------------------------------------
r9778 | simon | 2013-03-30 20:59:19 +0400 (, 30  2013) | 4 lines

Add a midend function to return the current random seed, parallel to
the existing one that returns the game id. No front end has so far
needed this, but one is about to.

------------------------------------------------------------------------
r9777 | simon | 2013-03-30 20:59:18 +0400 (, 30  2013) | 3 lines

Add documentation for the identify_game() function which I introduced
in r9749 and forgot to write up.

------------------------------------------------------------------------
r9776 | simon | 2013-03-30 20:59:17 +0400 (, 30  2013) | 4 lines

Found a bug in nullgame! Its vestigial game_redraw lacked a
draw_update, which isn't really setting a good example for people
cloning it :-) Add the missing draw_update call.

------------------------------------------------------------------------
r9773 | simon | 2013-03-11 23:58:28 +0400 (, 11  2013) | 7 lines

Remove a redundant and also erroneous memset.

(If you're going to memset a struct to 0 before filling in the fields
you care about, do use sizeof the struct rather than sizeof the
pointer; but also, if you're filling in _every_ field, there's no need
to bother anyway.)

------------------------------------------------------------------------
r9771 | jacob | 2013-03-10 17:56:12 +0400 (, 10  2013) | 4 lines

Clarify instructions for 'Range' -- I initially read the last point as
meaning the maximum white squares in any direction, rather than the total of
all directions.

------------------------------------------------------------------------
r9770 | jacob | 2013-03-10 16:49:06 +0400 (, 10  2013) | 3 lines

Make Unruly's keyboard controls match the documentation and other puzzles in
the collection -- now Enter = black and Space = white.

------------------------------------------------------------------------
r9769 | jacob | 2013-03-10 16:28:13 +0400 (, 10  2013) | 3 lines

Fix entering pencil marks from the keyboard; the cursor is no longer removed
(this brings Undead into line with Solo, etc).

------------------------------------------------------------------------
r9765 | simon | 2013-02-24 16:52:17 +0400 (, 24  2013) | 5 lines

Stop using CLUE2CHAR to translate clues into text; just do the obvious
sprintf in both locations (screen and print) that need it. Fixes a bug
in which clues greater than 9 came out as hex digits in printed
puzzles.

------------------------------------------------------------------------
r9751 | simon | 2013-01-19 22:56:07 +0400 (, 19  2013) | 15 lines

Stop the analysis pass in Loopy's redraw routine from being
conditionalised on !ds->started, so that we still do all the looping
over everything even if we know it's all going to be redrawn. This is
because deciding how much needs redrawing is not the only important
thing in those loops - they also set up arrays like ds->clue_error,
which tell the individual redraw functions _what_ to draw.

Fixes a bug in which, if you start a Loopy game and make moves causing
a clue to light up red for an error and then save your game, loading
the same save file at the start of a Loopy run would fail to highlight
the erroneous clue.

(This commit diff looks large, but actually it changes almost nothing
but whitespace.)

------------------------------------------------------------------------
r9750 | simon | 2013-01-19 22:56:06 +0400 (, 19  2013) | 6 lines

Bring Pearl's game-completion handling in line with my usual practice:
the 'completed' flag is not reset if you make a new move transforming
a solved game into an unsolved state, so the game won't flash again if
you manually erase and redraw a line segment (though it still will if
you undo and redo past the first solved state in the undo history).

------------------------------------------------------------------------
r9749 | simon | 2013-01-19 22:56:05 +0400 (, 19  2013) | 26 lines

Revamp of the Windows command-line parsing and puzzle-loading code.

The Windows puzzles now accept similar command-line syntax to the GTK
ones, in that you can give them either a game ID (descriptive, random
or just plain params) or the name of a save file. Unlike the GTK ones,
however, the save file interpretation is tried first; this is because
some puzzles (e.g. Black Box) will interpret any old string as a valid
(if boring) game ID, and unlike the GTK puzzles it's not feasible to
require users to disambiguate via a command-line option, because on
Windows a thing that might easily happen is that a user passes a save
file to a puzzle binary via 'Open With' in the GUI shell, where they
don't get the chance to add extra options.

In order to make this work sensibly in the all-in-one Windows app, I
had to get round to another thing I've been planning to do for a
while, which is to write a function to examine a saved game file and
find out which puzzle it's for. So the combined Windows binary will
auto-switch to the right game if you pass a save file on its command
line, and also if you use Load while the program is running.

Another utility function I needed is one to split the WinMain single
command line string into argv. For this I've imported a copy of
split_into_argv() from Windows PuTTY (which doesn't affect this
package's list of copyright holders, since that function was all my
own code anyway).

------------------------------------------------------------------------
r9737 | simon | 2013-01-09 12:04:24 +0400 (, 09  2013) | 5 lines

Pattern's display was broken for non-square puzzles, because
draw_numbers() was considerably confused between the width of the clue
border at the left and the height of the clue border at the top.
Unconfuse it (I think).

------------------------------------------------------------------------
r9733 | simon | 2012-12-28 15:22:13 +0400 (, 28  2012) | 5 lines

Actually do what the comment says at the top of main() regarding not
bombing out due to an option that we don't recognise but GTK will.
Somehow my basically workable plan had been completely nullified by
putting the error check in the wrong place.

------------------------------------------------------------------------
r9712 | simon | 2012-11-21 22:45:07 +0400 (, 21  2012) | 9 lines

Fix overnight build failure last night, by making the new call to
gtk_widget_get_allocation conditional on GTK being new enough to have
that function.

I'm assuming until someone proves otherwise that if it isn't that new,
then it also isn't one of the versions of GTK which exhibit the bug
which that call was working around (since gtk_widget_get_allocation
came in 2.18, and the problem seems to have arisen since 2.20).

------------------------------------------------------------------------
r9711 | simon | 2012-11-21 00:05:27 +0400 (, 21  2012) | 13 lines

Work around an annoying GTK behaviour I noticed the other day on my
Ubuntu 12.04 machine. What seems to happen is that we set up a window
containing a menu bar, a drawing area and a status bar, and set the
size of the drawing area; then the window is displayed _without_ the
menu bar; then we reduce the drawing area's size request to (1,1) to
let the user resize the window smaller; and now GTK gets round to
constructing the menu bar, and the drawing area helpfully shrinks a
bit to make room for it.

My fix is to set a 'shrink pending' flag instead of shrinking the
drawing area's size request, and defer the actual shrink operation
until the menu bar and status bar are both present.

------------------------------------------------------------------------
r9694 | simon | 2012-11-03 20:27:49 +0400 (, 03  2012) | 3 lines

A user points out that I could usefully clarify the Undead clue
semantics when a reflected sight-line crosses the same monster twice.

------------------------------------------------------------------------
r9682 | simon | 2012-10-07 19:41:44 +0400 (, 07  2012) | 2 lines

Remove an unused variable spotted by gcc 4.6.3.

------------------------------------------------------------------------
r9680 | simon | 2012-10-07 14:18:33 +0400 (, 07  2012) | 3 lines

New puzzle! 'Unruly', contributed by Lennard Sprong, is an
implementation of a puzzle usually called 'Tohu wa Vohu'.

------------------------------------------------------------------------
r9660 | simon | 2012-09-10 22:24:34 +0400 (, 10  2012) | 3 lines

Make indentation consistent. (Somehow I forgot to do this before I
originally committed the puzzle, as I usually do.)

------------------------------------------------------------------------
r9659 | simon | 2012-09-10 22:05:54 +0400 (, 10  2012) | 2 lines

Forgot to add the new 'const' in the unfinished subdirectory. Oops.

------------------------------------------------------------------------
r9658 | simon | 2012-09-10 01:55:14 +0400 (, 10  2012) | 2 lines

Oops, forgot to initialise changed_ascii on all paths in r9657.

------------------------------------------------------------------------
r9657 | simon | 2012-09-09 22:40:12 +0400 (, 09  2012) | 13 lines

New rule: interpret_move() is passed a pointer to the game_drawstate
basically just so that it can divide mouse coordinates by the tile
size, but is definitely not expected to _write_ to it, and it hadn't
previously occurred to me that anyone might try. Therefore,
interpret_move() now gets a pointer to a _const_ game_drawstate
instead of a writable one.

All existing puzzles cope fine with this API change (as long as the
new const qualifier is also added to a couple of subfunctions to which
interpret_move delegates work), except for the just-committed Undead,
which somehow had ds->ascii and ui->ascii the wrong way round but is
otherwise unproblematic.

------------------------------------------------------------------------
r9656 | jacob | 2012-09-09 15:50:05 +0400 (, 09  2012) | 2 lines

Minor tweaks to Undead docs.

------------------------------------------------------------------------
r9652 | simon | 2012-09-08 14:48:05 +0400 (, 08  2012) | 5 lines

New puzzle! Contributed by Steffen Bauer, an implementation of
'Haunted Mirror Maze', a game involving placing ghosts, zombies and
vampires in a grid so that the right numbers of them are visible along
sight-lines reflected through multiple mirrors.

------------------------------------------------------------------------
r9606 | simon | 2012-08-17 23:58:53 +0400 (, 17  2012) | 10 lines

For the convenience of Linux package maintainers, add to Makefile.gtk
and Makefile.doc a command-line parameter 'BINPREFIX' which will be
prepended to all the game binary names. E.g. 'make BINPREFIX=sgt-' and
'make BINPREFIX=sgt- install', and correspondingly 'make -f
Makefile.doc BINPREFIX=sgt-'.

Also included in this commit by mistake, changes to singles.c to add
\n to the end of all its debug() statements. I meant to commit that
separately. Oops.

------------------------------------------------------------------------
r9605 | simon | 2012-08-17 23:45:03 +0400 (, 17  2012) | 3 lines

Fix implicit split to @_. Also add 'use warnings', which would have
spotted it for me.

------------------------------------------------------------------------
r9594 | simon | 2012-07-30 01:29:26 +0400 (, 30  2012) | 4 lines

Don't fail an assertion when setting up the provided clues at the
start of the solver, if they contradict each other. (Could trigger on
user-provided grids.)

------------------------------------------------------------------------
r9561 | simon | 2012-06-10 11:20:18 +0400 (, 10  2012) | 14 lines

Vary the behaviour of Mines's solve function depending on whether the
user is already in the 'dead' state when they press it. If so, we
reveal the rest of the mines in the grid as if it were the Windows
Minesweeper 'you lose' display, which provides information showing
what the user got wrong. (Otherwise they have to repeatedly flick back
and forth between Solve and Undo if they want to work out which flag
they placed wrongly.)

If you press Solve while alive, however, the existing behaviour
remains unchanged.

(This feature was suggested by Clive Jones a couple of weeks after I
first wrote Mines, and I've finally got round to doing it!)

------------------------------------------------------------------------
r9558 | simon | 2012-06-06 21:59:37 +0400 (, 06  2012) | 5 lines

Fix a bug introduced by r9495 in which we try to write temporary NULs
into a string which is usually a read-only string literal. Instead,
copy each segment into writable memory as we need it, and free it
afterwards.

------------------------------------------------------------------------
r9549 | simon | 2012-06-01 22:41:26 +0400 (, 01  2012) | 9 lines

Add a hacky environment variable that lets me arrange a soak-test of a
solver I've just modified, by forcing every game generation to be
instantly followed by an attempt to re-solve the same game
_description_ without the aux_info.

I've hacked similar changes in to midend.c several times in the last
couple of months for one reason or another, and it's about time I
arranged not to have to recompile to do it!

------------------------------------------------------------------------
r9548 | simon | 2012-06-01 22:41:24 +0400 (, 01  2012) | 19 lines

Remove the speed optimisation in the stage 3 solver which makes the
first loop only handle rightward or downward bridges (on the basis
that that way every bridge is looked at once rather than twice). This
seems to be breaking in the wake of recent changes to the solver, in
cases such as when island A is left of island B and has enough other
outgoing edges that only one bridge remains to potentially go to B,
but B is as yet unconstrained. In this situation the only code which
is able to adjust the maximum bridge count for that edge is the stage
3 solver (nothing else calls solve_join with is_max true), but it will
only do so if it _tries_ putting two bridges there and finds it
impossible, and when it starts from island A it won't even try.

Game ID which was insoluble just before this commit:
15x15m2:2a4d3b3c2h2d2a2a3c3w4a3m1d1a4a5a2d4d6e4q3e6a2a1e1b2g3a3o2g1d32l4b2c3a4c2b22l4a

This probably means I've done something else in recent checkins which
was not in accordance with the original solver design. However, this
fix will do for the moment.

------------------------------------------------------------------------
r9547 | simon | 2012-06-01 22:41:23 +0400 (, 01  2012) | 4 lines

Another uninitialised-variable fix, this one pointing out a real bug.
Simplest fix is to just remove the 'n' parameter from
solve_island_subgroup, replacing it with a robust island_countbridges.

------------------------------------------------------------------------
r9546 | simon | 2012-06-01 22:41:23 +0400 (, 01  2012) | 7 lines

Add pointless initialisations to placate a gcc warning.

(I'm confident these can't happen. maxb is initialised whenever we
break from the first loop with y < h, and when we don't break from
that loop the second loop which uses maxb is run zero times. But gcc
can't work that out, sigh.)

------------------------------------------------------------------------
r9544 | simon | 2012-05-31 22:10:12 +0400 (, 31  2012) | 2 lines

Write a comment outlining a design for a rewritten faster solver.

------------------------------------------------------------------------
r9543 | simon | 2012-05-31 22:10:11 +0400 (, 31  2012) | 12 lines

Bridges solver enhancement. In the stage 3 solver, we were considering
the possibility that an island might form an isolated subgraph by
connecting to one of its neighbours (and, if so, reducing the maximum
bridge count in that direction so that some bridge would have to go
elsewhere), but we were not also considering the possibility that it
might form an isolated subgraph by connecting to _more_ than one of
its neighbours. For instance, if you have a 3 adjacent to a 1, a 2 and
something else, then at least one bridge must go to the something-else.

Previously insoluble test case:
10x10m2:a2b4a5a2a2a1ga2d3b33a3a4c2aa3e1a22b2a4b4aa3b1a2b33a1e3aa2a1a2c23a3a3a4a2a

------------------------------------------------------------------------
r9542 | simon | 2012-05-31 22:10:10 +0400 (, 31  2012) | 3 lines

Bridges solver fix: in map_update_possibles, collect values from
maxh/maxv for squares between islands as well as on islands.

------------------------------------------------------------------------
r9534 | simon | 2012-05-14 22:42:19 +0400 (, 14  2012) | 6 lines

Patch from Jonas Koelker to improve Filling's error highlighting: as
well as marking a region as wrong if it has too many squares for the
number written in it, this patch now causes a region to be marked
wrong if it has too few squares _and no liberties_, so that it can't
just be one the user is intending to enlarge later.

------------------------------------------------------------------------
r9533 | simon | 2012-05-14 22:42:18 +0400 (, 14  2012) | 4 lines

Patch from Jonas Koelker for the developer docs, fixing a couple of
editing errors and adding some comments about the necessary order of
midend operations called by a front end.

------------------------------------------------------------------------
r9505 | simon | 2012-05-06 18:01:39 +0400 (, 06  2012) | 4 lines

GNUstep compatibility: ensure both endpoints are actually drawn by
draw_line, by the brute-force method of explicitly plotting them in
addition to the GUI's line-drawing operation.

------------------------------------------------------------------------
r9504 | simon | 2012-05-06 18:01:38 +0400 (, 06  2012) | 2 lines

GNUstep compatibility: add a missing #include.

------------------------------------------------------------------------
r9503 | simon | 2012-05-06 18:01:36 +0400 (, 06  2012) | 5 lines

GNUstep compatibility: avoid attempting blitter_save with a partially
out-of-bounds rectangle. Instead, take the intersection of the
rectangle with the window boundary and do a smaller operation on
what's left.

------------------------------------------------------------------------
r9502 | simon | 2012-05-06 18:01:35 +0400 (, 06  2012) | 12 lines

GNUstep compatibility: stop using the API feature isFlipped/setFlipped
to translate y-coordinates from the default of up-from-bottom to the
down-from-top expected by these puzzles, because it doesn't work right
on GNUstep. Instead, we run the API in its default mode (probably a
more robust choice anyway) and translate coordinates manually in the
front end.

In the process, I've separates the processButton: method into one for
mouse buttons and one for keys, since that was the easiest way to
ensure the coordinates passed to the mid-end for the latter are -1,-1
_after_ translation rather than before.

------------------------------------------------------------------------
r9501 | simon | 2012-05-06 18:01:35 +0400 (, 06  2012) | 3 lines

GNUstep compatibility: remove an unused variable which the compiler
warned about.

------------------------------------------------------------------------
r9500 | simon | 2012-05-06 18:01:34 +0400 (, 06  2012) | 3 lines

GNUstep compatibility: comment out some API calls that GNUstep
apparently doesn't have. Fortunately they were optional anyway.

------------------------------------------------------------------------
r9499 | simon | 2012-05-06 18:01:32 +0400 (, 06  2012) | 2 lines

GNUstep compatibility: spell null selectors "NULL", not "nil".

------------------------------------------------------------------------
r9498 | simon | 2012-05-06 18:01:32 +0400 (, 06  2012) | 6 lines

Add a section to mkfiles.pl to build a makefile that compiles the OS X
front end using GNUstep, yielding a Unix program built from the same
code. Should make it easier to check OS X behaviour without having to
move as far as a Mac :-) However, it doesn't compile as is, so I'll
apply fixes to the code until it does.

------------------------------------------------------------------------
r9495 | simon | 2012-05-06 15:36:32 +0400 (, 06  2012) | 2 lines

Stop using the deprecated NSString stringWithCString: methods.

------------------------------------------------------------------------
r9494 | simon | 2012-05-06 15:35:59 +0400 (, 06  2012) | 3 lines

Update the OS X makefile so I can build on Lion. Regrettably that
means I have to withdraw support for OS X 10.3 and PPC.

------------------------------------------------------------------------
r9455 | simon | 2012-04-10 23:51:57 +0400 (, 10  2012) | 3 lines

Permit users to reconfigure the default setting for each puzzle using
another of those hacky environment variables.

------------------------------------------------------------------------
r9454 | simon | 2012-04-08 17:45:10 +0400 (, 08  2012) | 3 lines

Add a difficulty exception to prevent Pearl spinning forever when
asked to generate a 5x5 Tricky puzzle. (Debian bug #667963)

------------------------------------------------------------------------
r9453 | simon | 2012-04-08 17:45:09 +0400 (, 08  2012) | 2 lines

Typo fix from Helge Kreutzmann, forwarded from Debian.

------------------------------------------------------------------------
r9452 | simon | 2012-04-08 17:06:47 +0400 (, 08  2012) | 4 lines

Increase by 1 pixel the clip rectangle used to draw and erase the
Black Box finish button. Like the Guess blitter, it was assuming
non-expansion of circles.

------------------------------------------------------------------------
r9451 | simon | 2012-04-08 17:06:46 +0400 (, 08  2012) | 3 lines

Swap a 'max' for a 'min', fixing an out-of-range colour component
being passed to the front end.

------------------------------------------------------------------------
r9450 | simon | 2012-04-08 17:06:45 +0400 (, 08  2012) | 5 lines

Increase by 1 in every direction the size of the blitter used to save
the background under a Guess coloured peg in mid-drag. Currently it
assumes the circle doesn't extend into the next pixel, which the docs
for draw_circle warn might happen due to antialiasing.

------------------------------------------------------------------------
r9448 | simon | 2012-04-08 02:28:59 +0400 (, 08  2012) | 6 lines

Add an explicit -lm to the link lines in Makefile.gtk, after two users
reported on the same day that this is now necessary since up-to-date
GNU tools won't consider it sufficient to have libm be a dependency of
other explicitly referenced libraries if you're directly referring to
the contents of libm yourself.

------------------------------------------------------------------------
r9447 | simon | 2012-04-08 02:19:18 +0400 (, 08  2012) | 6 lines

Fix redundant redrawing in Pegs. Apparently it has always redrawn
every single peg and hole on the board, every time it did any kind of
redraw at all, because I forgot to update the array in the drawstate
indicating the last-drawn state of each position. And nobody's noticed
until now!

------------------------------------------------------------------------
r9446 | simon | 2012-04-08 02:19:17 +0400 (, 08  2012) | 3 lines

Change some instances of 'print $thing' to 'print $thing || ""', to
prevent annoying Perl warnings when $thing is undefined.

------------------------------------------------------------------------
r9445 | simon | 2012-04-06 16:34:34 +0400 (, 06  2012) | 12 lines

Error checking in Pattern, which was until now the only remaining game
that _ought_ to have it but did not.

I've tried to implement it before and found that the most obvious
approach was so effective as to constitute a spoiler, so this is a
deliberately weakened approach which in a bit of play-testing seems to
be a more sensible balance. It won't necessarily tell you at the very
instant you put a foot wrong, but it will at least ensure that (my
usual minimum standard) once you've filled in the whole grid you will
either have seen a victory flash, or an error indicator showing you
why not.

------------------------------------------------------------------------
r9442 | simon | 2012-04-03 16:49:22 +0400 (, 03  2012) | 3 lines

Comment the Mac build out of Buildscr, since I no longer have a
working Mac and hence can't build it any more.

------------------------------------------------------------------------
r9411 | simon | 2012-02-19 14:15:59 +0400 (, 19  2012) | 2 lines

Patch from Jonas Koelker to add keyboard control support to Pearl.

------------------------------------------------------------------------
r9408 | simon | 2012-02-17 23:07:31 +0400 (, 17  2012) | 7 lines

Tweak a conditional expression in pearl.c to work around a display bug
in the Java build - which turns out to be a JVM bug in OpenJDK 6,
causing the NestedVM rendition of the expression (i==1?3:4) to be
mis-JITed. OpenJDK 7 appears not to do that any more, but this
equivalent (for these purposes) rephrasing should perturb the code
just enough to dodge the problem.

------------------------------------------------------------------------
r9406 | simon | 2012-02-14 01:10:47 +0400 (, 14  2012) | 2 lines

Fix one-character typo in r9405 which was breaking right-clicks.

------------------------------------------------------------------------
r9405 | simon | 2012-02-09 03:31:58 +0400 (, 09  2012) | 7 lines

David Nickerson reports odd behaviour involving a drag start point
persisting between separate mouse actions. Revamp all uses of the
ndragcoords field in an attempt to stamp that out: we now distinguish
between active drags (>0), a valid click but no drag yet (0), and a
totally invalid situation in which all mouse activity will be ignored
until the next fresh attempt (-1).

------------------------------------------------------------------------
r9403 | simon | 2012-02-03 03:04:46 +0400 (, 03  2012) | 2 lines

Correct kdiff setting.

------------------------------------------------------------------------
r9402 | simon | 2012-02-03 03:04:43 +0400 (, 03  2012) | 7 lines

Don't try to run solver_killer_sums on a Killer cage with only one
square. It isn't equipped for it, and will try to handle it with the
4-square case and get confused. This can come up if the
DIFF_KINTERSECT pass before that split a cage, and will cause the
solver to miss valid solutions; e.g. 3x3kadu#802065940985372 would
generate an ambiguous puzzle before this change.

------------------------------------------------------------------------
r9401 | simon | 2012-02-03 03:04:38 +0400 (, 03  2012) | 2 lines

Fix a couple of typos in messages.

------------------------------------------------------------------------
r9400 | simon | 2012-02-02 11:18:14 +0400 (, 02  2012) | 7 lines

David Nickerson reports that it's possible to lay a line over a 'no
line here' cross mark by dragging, and furthermore, that doing so puts
that grid edge into a stuck state that no UI action short of undo can
get it back out of. Fix drags to stop at crosses, and fix execute_move
to fault any move string that nonetheless somehow managed to try to
set a line over a cross without explicitly tagging it 'R'.

------------------------------------------------------------------------
r9399 | simon | 2012-02-02 11:15:48 +0400 (, 02  2012) | 6 lines

Arrgh! Revert r9395,r9396,r9397,r9398, all of which I just committed
by mistake in one go by running git-svn dcommit on the wrong branch.
Those were patches recently submitted by a user but which are not of
production quality (yet?) and I meant to keep them in my local
experimental repository. Sorry.

------------------------------------------------------------------------
r9398 | simon | 2012-02-02 11:13:17 +0400 (, 02  2012) | 2 lines

Fixed decoding bug for dual grids

------------------------------------------------------------------------
r9397 | simon | 2012-02-02 11:13:15 +0400 (, 02  2012) | 2 lines

Added dual floret preset

------------------------------------------------------------------------
r9396 | simon | 2012-02-02 11:13:14 +0400 (, 02  2012) | 4 lines

Added "dual" option to grid generators

It is now possible to produce duals of all grids.

------------------------------------------------------------------------
r9395 | simon | 2012-02-02 11:13:12 +0400 (, 02  2012) | 14 lines

Can now take the dual of a grid

Taking the dual of a grid creates a new grid with one vertex
for each face of the original and one face for each vertex. This
allows the easy introduction of a new grid type, the dual of the
octagonal grid, which is a square grid in which each square is split
into four triangles.

Of the grid types currently present, square is its own dual,
honeycomb is the dual of triangles, cairo is the dual of snub-squares,
kites is the dual of great-hexagonal, and the dodecagonal ones would
have vertices with twelve edges, probably not practical. The others
all have duals that would introduce new classes of puzzle.

------------------------------------------------------------------------
r9393 | simon | 2012-01-31 12:38:42 +0400 (, 31  2012) | 8 lines

Sort out a bit of confusion between mouse- and keyboard-driven drags
in Rectangles. Mouse drags now take priority - you can't start a
keyboard drag while the mouse is held down, and starting a mouse drag
instantly cancels an unfinished keyboard drag - and also I've fixed an
assertion failure which would come up if you had the keyboard cursor
visible at the end of a mouse drag (by pressing arrow keys while the
mouse was held down).

------------------------------------------------------------------------
r9392 | simon | 2012-01-31 12:32:26 +0400 (, 31  2012) | 7 lines

Move a debug statement at the end of new_clues from the caller (just
after return) to the callee (just before). Might print something
useful in the soak-test context (where that debug statement will now
be printed and previously wasn't), but the main aim is to remove the
variable 'ngen' at the main call site, which triggered a set-but-not-
used warning if the debug statement that printed it was compiled out.

------------------------------------------------------------------------
r9388 | simon | 2012-01-23 23:12:12 +0400 (, 23  2012) | 7 lines

Add comments suggesting some solver upgrades to Light Up (perhaps for
a new sub-recursive difficulty level?), inspired by a user emailing in
the game ID
18x10:gBc1b2g2e2d1b2c2h2e3c2dBd1g1bBb2b1fBbBb1bBgBd2dBi1h1c2b1dBe2bBdBb3cBg
which I was able to solve without backtracking by the use of these
techniques.

------------------------------------------------------------------------
r9387 | simon | 2012-01-23 22:56:05 +0400 (, 23  2012) | 4 lines

The Light Up solver limits its recursion depth, so if it fails to find
a solution then it should not deduce that no solution exists. Change
wording of the error message returned from the Solve user action.

------------------------------------------------------------------------
r9386 | simon | 2012-01-23 22:56:04 +0400 (, 23  2012) | 5 lines

Fix default parameter assignment in Light Up when validating an
incomplete parameter string: if the user hand-types a game ID along
the lines of '18x10:stuff', we should not assume SYMM_ROT4 in the
resulting game_params, since it'll be failed by validate_params.

------------------------------------------------------------------------
r9384 | simon | 2012-01-22 19:52:14 +0400 (, 22  2012) | 5 lines

Trivial and silly patch to allow users to configure the Signpost
victory roll so that adjacent arrows rotate in opposite directions,
giving the impression that they're an interlocking field of gears.
Possibly even more brain-twisting than the original version :-)

------------------------------------------------------------------------
r9382 | jacob | 2012-01-22 19:44:04 +0400 (, 22  2012) | 3 lines

It's a new year.
(It was a new year this time last year, too.)

------------------------------------------------------------------------
r9381 | simon | 2012-01-22 19:12:56 +0400 (, 22  2012) | 2 lines

Tweak right-click processing to be less finicky.

------------------------------------------------------------------------
r9379 | simon | 2012-01-22 18:14:26 +0400 (, 22  2012) | 10 lines

New puzzle! Or rather, new-ish, because this one has been lying around
in the 'unfinished' directory for a while, and has now been finished
up thanks to James Harvey putting in some effort and galvanising me to
put in the rest. This is 'Pearl', an implementation of Nikoli's 'Masyu'.

The code in Loopy that generates a random loop along grid edges to use
as the puzzle solution has been abstracted out into loopgen.[ch] so
that Pearl can use it for its puzzle solutions too. I've also
introduced a new utility module called 'tdq' (for 'to-do queue').

------------------------------------------------------------------------
r9377 | simon | 2012-01-17 22:53:02 +0400 (, 17  2012) | 8 lines

Fix a bug causing premature defeatism in the Bridges solver. Deducing
a better upper bound on the number of bridges leaving a given island
in a given direction was not counted as having 'done something'; so a
solver run could make several such deductions, but then terminate in
the belief that it hadn't achieved anything, when just going back
round the main solver loop would have enabled it to make further
deductions based on those new bounds.

------------------------------------------------------------------------
r9375 | simon | 2011-12-28 22:17:30 +0400 (, 28  2011) | 3 lines

Allow --save to work with --soln, causing saved game files to be
written out with the Solve operation having already been performed.

------------------------------------------------------------------------
r9374 | simon | 2011-12-28 22:07:46 +0400 (, 28  2011) | 3 lines

Fix bug in error reporting for --save caused by freeing 'realname'
before the error messages wanted to use it.

------------------------------------------------------------------------
r9373 | simon | 2011-12-28 22:07:46 +0400 (, 28  2011) | 3 lines

Fix bug in --save caused by failure to initialise ctx.error to zero
before later checking to see if an errno code was dumped in it.

------------------------------------------------------------------------
r9372 | simon | 2011-12-21 17:46:48 +0400 (, 21  2011) | 3 lines

In Group, the keyboard-controlled cursor should respect user
rearrangement of the rows and columns.

------------------------------------------------------------------------
r9306 | simon | 2011-09-18 11:43:19 +0400 (, 18  2011) | 17 lines

Remove the 'cheated' flag in Range's game_ui, which was stickily
remembering whether the player had ever used the hint or solve
functions, even if they then pressed undo (and even if they saved and
restored).

As far as Solve+Undo is concerned, this just brings Range into line
with common practice in the rest of my puzzles. On the other hand,
Range is the first time there's been a 'hint' function to consider in
this question, so here's a policy decision: the victory flash is not a
congratulation for a puzzle solved unaided, it's a confirmation that
you really have reached a correct solution and haven't made any
mistakes. So the only reason to omit the victory flash is if you've
used the Solve operation to go straight to a guaranteed-correct
solution _in a single move_; if you're using the hint button, there's
still scope for you to make mistakes in all your non-hint moves, so
the victory flash is still a useful indicator that you didn't.

------------------------------------------------------------------------
r9305 | simon | 2011-09-18 11:43:18 +0400 (, 18  2011) | 5 lines

When we run out of background colours for chains and wrap back to the
beginning, we should wrap back to COL_B0+1 rather than COL_B0 itself,
so as not to reuse white. White should be special, and always indicate
a properly numbered square.

------------------------------------------------------------------------
r9304 | simon | 2011-09-18 11:43:18 +0400 (, 18  2011) | 5 lines

Patch from Chris Boyle to fix Signpost's labelling when you have more
than 26 separate linked chains of unnumbered squares: we now wrap from
'z' to an Excel-like 'aa', 'ab', ..., instead of falling off z into
punctuation and control characters.

------------------------------------------------------------------------
r9179 | simon | 2011-06-19 17:43:35 +0400 (, 19  2011) | 13 lines

Changed my mind about midend_is_solved: I've now reprototyped it as
midend_status(), and given it three return codes for win, (permanent)
loss and game-still-in-play. Depending on what the front end wants to
use it for, it may find any or all of these three states worth
distinguishing from each other.

(I suppose a further enhancement might be to add _non_-permanent loss
as a fourth distinct status, to describe situations in which you can't
play further without pressing Undo but doing so is not completely
pointless. That might reasonably include dead-end situations in Same
Game and Pegs, and blown-self-up situations in Mines and Inertia.
However, I haven't done this at present.)

------------------------------------------------------------------------
r9175 | simon | 2011-05-22 11:07:47 +0400 (, 22  2011) | 6 lines

Pass background colour as a parameter to draw_gts and draw_adjs, so
that we can pass -1 in calls from game_print(). Fixes a printing bug
in which all the adjs and gts were overlaid with giant black
rectangles! (Because COL_BACKGROUND doesn't mean the same thing in
that context.)

------------------------------------------------------------------------
r9173 | simon | 2011-05-11 22:11:28 +0400 (, 11  2011) | 5 lines

Fix segfault in Loopy printing, introduced when I added the dynamic
arrays 'textx' and 'texty' to the game_drawstate but failed to
initialise them in the temporary drawstate used by game_print().
Thanks to Arun Giridhar for spotting this.

------------------------------------------------------------------------
r9170 | simon | 2011-05-07 17:22:17 +0400 (, 07  2011) | 13 lines

Having played Keen a bit following the clue-generation fix in r9165,
I've decided that the extremely low density of one-option
multiplication clues is not a universally good idea after all: it
seems to me to make puzzles _quantitatively_ harder, even if Keen's
difficulty-level system can't see any difference in the set of modes
of reasoning required at least once to solve the grid.

So I've readjusted the clue selection, so that multiplicative clues
with only one workable pair of factors are restored to 'good' status
at Normal difficulty level and below, and only considered less-than-
fully-desirable at Hard and above. I think that's a reasonable
compromise.

------------------------------------------------------------------------
r9168 | simon | 2011-05-06 21:09:03 +0400 (, 06  2011) | 17 lines

Apply the rotation in Penrose grid descriptions by rotating in the
4-vector representation, rather than mucking about with sines and
cosines after grid generation. _Should_ make no difference in the
generated grids (there's a theoretical risk of an unlucky rounding
error just about managing to push some point in or out of bounds, but
I think it's vanishingly small), but simplifies the coordinate-
flattening procedure, and in particular increases its chance of
getting vertical lines actually vertical.

(Prior to this change, the game ID
10x10t12:G2554,-31,108_a3b12h0a212a3d102b2a23a2e3b01b0a2c2a0c0 was
generating a not-quite-vertical edge at top left, in the Java port but
not on Linux; I suspect differences in sin and cos as the cause of the
discrepancy. With the rotation done like this, the points'
x-coordinates are now computed without reference to their
y-coordinates.)

------------------------------------------------------------------------
r9167 | simon | 2011-05-05 21:13:16 +0400 (, 05  2011) | 3 lines

Apply a missing bit of r9164, which only broke the build with
-DDEBUGGING so I didn't notice it at the time.

------------------------------------------------------------------------
r9166 | simon | 2011-05-04 22:41:21 +0400 (, 04  2011) | 5 lines

Portability fixes, mostly from James for Palm purposes. Mostly
additions of missing 'static' and explicit 'void' in parameter lists,
plus one or two other things like explicitly casting chars in variadic
argument lists to int and using DBL_MAX if HUGE_VAL isn't available.

------------------------------------------------------------------------
r9165 | simon | 2011-05-04 22:22:15 +0400 (, 04  2011) | 7 lines

Having looked at Keen's clue selection code, I also notice that the
intended behaviour of classifying multiplication clues as low-quality
if they only left one possible pair of multiplicands has never
actually worked, because I should have compared the possible clue
count against 2 rather than 1 since the multiplicands can occur either
way round.

------------------------------------------------------------------------
r9164 | simon | 2011-05-04 22:22:14 +0400 (, 04  2011) | 7 lines

Fix warnings generated by gcc 4.6.0 about variables set but not
thereafter read. Most of these changes are just removal of pointless
stuff or trivial reorganisations; one change is actually substantive,
and fixes a bug in Keen's clue selection (the variable 'bad' was
unreferenced not because I shouldn't have set it, but because I
_should_ have referenced it!).

------------------------------------------------------------------------
r9163 | simon | 2011-04-26 17:44:27 +0400 (, 26  2011) | 3 lines

Fix two memory leaks reported by Tiago Dionizio in recent Loopy
development.

------------------------------------------------------------------------
r9161 | simon | 2011-04-26 02:41:54 +0400 (, 26  2011) | 3 lines

Forgot to set 'has_incentre' on triangular grids, which don't use
grid_face_add_new(). Oops.

------------------------------------------------------------------------
r9159 | simon | 2011-04-24 13:10:52 +0400 (, 24  2011) | 15 lines

From James Harvey (via a period of collaborative polishing), a patch
to add two kinds of Penrose tiling to the grid types supported by
Loopy.

This has involved a certain amount of infrastructure work, because of
course the whole point of Penrose tilings is that they don't have to
be the same every time: so now grid.c has grown the capacity to
describe its grids as strings, and reconstitute them from those string
descriptions. Hence a Penrose Loopy game description consists of a
string identifying a particular piece of Penrose tiling, followed by
the normal Loopy clue encoding.

All the existing grid types decline to provide a grid description
string, so their Loopy game descriptions have not changed encoding.

------------------------------------------------------------------------
r9158 | simon | 2011-04-23 17:03:38 +0400 (, 23  2011) | 4 lines

Oops: initialise that new 'has_incentre' flag to false, otherwise the
game will sometimes pick random incentres in place of the carefully
computed ones. Ahem.

------------------------------------------------------------------------
r9157 | simon | 2011-04-23 15:44:43 +0400 (, 23  2011) | 7 lines

Move most of face_text_pos() into grid.c, leaving in loopy.c only the
part that converts from abstract grid coordinates into screen
coordinates. This should speed up window-resizing by eliminating
pointless reiteration of the complicated part of the algorithm: now
when a game_drawstate is renewed, only the conversion into screen
coordinates has to be redone.

------------------------------------------------------------------------
r9156 | simon | 2011-04-23 15:44:41 +0400 (, 23  2011) | 3 lines

Replace my brute-force algorithm in face_text_pos with a more complex
but faster and more mathematically sensible one.

------------------------------------------------------------------------
r9155 | simon | 2011-04-23 15:44:41 +0400 (, 23  2011) | 3 lines

Stop calling face_text_pos() for faces that don't need to have text in
them anyway. It's slow and pointless.

------------------------------------------------------------------------
r9154 | simon | 2011-04-23 15:37:46 +0400 (, 23  2011) | 3 lines

Support user-specified extra link flags (XLFLAGS) in the Unix
makefile. Makes it easy to recompile for things like profiling.

------------------------------------------------------------------------
r9151 | simon | 2011-04-11 21:32:44 +0400 (, 11  2011) | 8 lines

Fix mismatch between printf format strings and arguments in some
solosolver verbose diagnostics in X mode. Also added gcc-specific
prototypes with __attribute__((format)) to ensure they all get checked
in future.

Spotted by Arun Giridhar; segfault without this fix is reproducible by
'solosolver -v 3x3x:7_9e4_1c7d3e3d1b2_4e2c6e5_6b1d8e5d9c8_2e9_5'.

------------------------------------------------------------------------
r9147 | simon | 2011-04-05 22:05:57 +0400 (, 05  2011) | 2 lines

Remove a stray diagnostic.

------------------------------------------------------------------------
r9146 | simon | 2011-04-05 22:05:57 +0400 (, 05  2011) | 4 lines

Fix an amusing cut-and-paste error in the Java drawing code which was
causing complete mis-draws - but only when the window was exactly the
right size!

------------------------------------------------------------------------
r9145 | simon | 2011-04-05 21:45:48 +0400 (, 05  2011) | 4 lines

Adjust the yellow used for LINE_UNKNOWN so that it's always a bit
darker than the background, because the Java front end demonstrates
that it's a bit eyewatering when it _matches_ the background.

------------------------------------------------------------------------
r9144 | simon | 2011-04-03 13:16:08 +0400 (, 03  2011) | 2 lines

Trivial markup fix.

------------------------------------------------------------------------
r9143 | simon | 2011-04-03 11:59:35 +0400 (, 03  2011) | 7 lines

Add a new deduction to Easy level, which is as small as I can make it
to have the effect of enabling large Easy-level grids to be
constructed in all grid types. Without this, some generations at Easy
level (e.g. 'loopy --generate 1 7x7t9de') can spin forever because
_even with all clues filled in_ the generated grids can't be solved at
that level.

------------------------------------------------------------------------
r9142 | simon | 2011-04-03 11:55:18 +0400 (, 03  2011) | 5 lines

Move up midend_is_solved() in the developer docs from subheading to
heading level. It's _almost_ apt to have it as a subheading of
midend_solve(), but not quite, and it certainly wasn't intentional - I
must have absentmindedly typed the wrong Halibut command letter.

------------------------------------------------------------------------
r9140 | simon | 2011-04-02 20:19:12 +0400 (, 02  2011) | 8 lines

Add a function to every game backend which indicates whether a game
state is in a solved position, and a midend function wrapping it.

(Or, at least, a situation in which further play is pointless. The
point is, given that game state, would it be a good idea for a front
end that does that sort of thing to proactively provide the option to
start a fresh game?)

------------------------------------------------------------------------
r9139 | simon | 2011-04-02 19:36:30 +0400 (, 02  2011) | 3 lines

Add functions provided by the midend to tell a front end whether GUI
buttons for undo and redo should currently be greyed out.

------------------------------------------------------------------------
r9138 | simon | 2011-04-02 19:19:29 +0400 (, 02  2011) | 13 lines

Rework the Loopy grid drawing algorithm so that it doesn't assume when
it clears a clipping region that it knows what features will need
redrawing in that region. Instead, I've moved all the clip/unclip/draw
functionality out into a game_redraw_in_rect() function which checks
_everything_ on the grid to see if it lies in the region.

As far as I can tell the effect only shows up in grid types that
aren't checked in, but it makes the code look nicer too.

(It would be nicer still to avoid the brute-force loop over the whole
grid checking it against the bounding box, particularly when we're
drawing in multiple bounding boxes. But this will do for the moment.)

------------------------------------------------------------------------
r9137 | simon | 2011-04-02 19:19:29 +0400 (, 02  2011) | 9 lines

Improve the algorithm for figuring out where the number should be
drawn in a face: averaging the vertex positions works fine for regular
or roughly regular convex polygons, but it'll start being a pain for
odder or concave ones.

This is a kludgey brute-force algorithm; I have ideas about more
elegant ways of doing this job, but they're more fiddly, so I thought
I'd start with something that basically worked.

------------------------------------------------------------------------
r9136 | simon | 2011-04-02 17:15:56 +0400 (, 02  2011) | 7 lines

When a lot of edges meet the same point - and, in particular, when
they meet at sharp enough angles that the thick lines overlap
noticeably outside the circle of the point - redrawing the edges in a
different order each time looks ugly. Arrange to always redraw edges
in order of colour, so that empty lines are drawn before indeterminate
lines which in turn come before filled-in lines.

------------------------------------------------------------------------
r9109 | simon | 2011-02-24 22:06:49 +0300 (, 24  2011) | 3 lines

Another patch from Chris Moore implementing two more grid types, both
involving dodecagons.

------------------------------------------------------------------------
r9108 | simon | 2011-02-24 22:06:48 +0300 (, 24  2011) | 8 lines

Retire the 'middle_face' field in 'struct grid', together with the
overly complicated algorithm that uses it to home in on the grid edge
closest to a mouse click. That algorithm is being stressed beyond its
limit by the new grid type, and it's unnecessary anyway given that no
sensibly sized puzzle grid is going to be big enough to make it
prohibitively expensive just to do the trivial approach of iterating
over all edges and finding the closest of the eligible ones.

------------------------------------------------------------------------
r9107 | simon | 2011-02-23 23:05:42 +0300 (, 23  2011) | 3 lines

Patch from Chris Moore to implement an extra grid type, the 'floret'
pentagonal tiling.

------------------------------------------------------------------------
r9106 | simon | 2011-02-23 23:05:40 +0300 (, 23  2011) | 4 lines

Patch from Chris Moore to improve the generality of
grid_nearest_edge(), by having it search harder for a better dot to
move to in the first loop.

------------------------------------------------------------------------
r9084 | simon | 2011-02-09 01:13:18 +0300 (, 09  2011) | 7 lines

Another UI feature for Group: now you can click between two legend
elements to toggle thick lines in the grid. Helps to delineate
subgroups and cosets, so it's easier to remember what you can
legitimately fill in by associativity.

(I should really stop fiddling with this game's UI; it's far too silly.)

------------------------------------------------------------------------
r9083 | simon | 2011-02-03 22:49:19 +0300 (, 03  2011) | 4 lines

The printing function in Bridges was unable to cope with more than two
bridges between a pair of islands! Good grief. How did we never spot
that before?

------------------------------------------------------------------------
r9076 | simon | 2011-01-09 14:30:09 +0300 (, 09  2011) | 2 lines

Fix error highlighting after table rearrangement.

------------------------------------------------------------------------
r9075 | simon | 2011-01-08 18:53:25 +0300 (, 08  2011) | 5 lines

Add the ability to reorder the rows and columns in Group. It becomes
much easier to keep track of things if, once you've identified a
cyclic subgroup, you can move it into a contiguous correctly ordered
block.

------------------------------------------------------------------------
r9073 | simon | 2011-01-06 21:37:05 +0300 (, 06  2011) | 8 lines

Introduce a mechanism in Buildscr for optionally building some of the
(more finished) puzzles in 'unfinished', as Java applets only. (The
rationale being: puzzles in 'unfinished' can be played locally by
people who go to the extra effort of downloading and building the
source, but to play them in Java is particularly inconvenient unless I
build the Java version myself. I just won't link it from the front
page.)

------------------------------------------------------------------------
r9023 | simon | 2010-11-06 21:14:42 +0300 (, 06  2010) | 6 lines

Also, it's ugly to blank out pieces of the applet window in black.
Use the puzzle background colour, like the GTK front end does.

(I know that renders the effect of the previous commit invisible,
but it's the principle of the thing! :-)

------------------------------------------------------------------------
r9022 | simon | 2010-11-06 21:14:41 +0300 (, 06  2010) | 11 lines

In the Java front end, don't try to guess the puzzle rectangle's
width and height by assuming mirror symmetry within the containing
applet area. Instead, use the proper width and height as given back
by the C sizing function.

(In particular, this fixes a bug where the non-blanked puzzle area
appeared too tall by the height of the menu bar, probably as a
result of confusing PuzzleApplet.getHeight() with
PuzzlePanel.getHeight(). But the mirroring approach was conceptually
wrong anyway.)

------------------------------------------------------------------------
r9021 | simon | 2010-11-06 20:47:46 +0300 (, 06  2010) | 5 lines

Fixes to r8997: firstly, move the fix out of #ifdef CAIRO so that it
applies to both drawing mechanisms, and secondly, make sure to paint
the spare pieces of window in the _puzzle's_ background colour
rather than the (sometimes slightly different) system default.

------------------------------------------------------------------------
r9013 | simon | 2010-10-01 15:46:32 +0400 (, 01  2010) | 6 lines

Liam Clarke points out that the use of the word 'radius' to describe
the size of the rotating sections in Twiddle is a misnomer, since
it's actually measuring something more like the diameter of the
section. Replace the word throughout with 'rotating block size' or
similar.

------------------------------------------------------------------------
r9001 | simon | 2010-09-20 14:36:44 +0400 (, 20  2010) | 2 lines

Memory leak fixes from Jonas Koelker.

------------------------------------------------------------------------
r8997 | simon | 2010-09-14 14:55:06 +0400 (, 14  2010) | 11 lines

Jonas Koelker reports that using the version of GTK currently in
Debian sid (2.20.1), there's a redraw problem when the window has a
different aspect ratio from the puzzle (due to resizing or
maximising): pieces of the window outside the real puzzle rectangle
don't get redrawn when exposed (e.g. by the drop-down menus).

Introduced code to explicitly redraw the whole exposed area,
including the parts that fall outside the pixmap. This makes the
problem go away in my hasty test install of sid, and doesn't seem to
affect the build on lenny.

------------------------------------------------------------------------
r8996 | simon | 2010-09-14 13:31:52 +0400 (, 14  2010) | 4 lines

New puzzle from Jonas Koelker: 'Range', an implementation of the
puzzle variously known (depending on which website you look at) as
Kurodoko, Kuromasu or 'Where is Black Cells'.

------------------------------------------------------------------------
r8995 | simon | 2010-09-14 13:30:39 +0400 (, 14  2010) | 2 lines

Update ignore properties on the unfinished subdir.

------------------------------------------------------------------------
r8972 | simon | 2010-07-05 02:57:05 +0400 (, 05  2010) | 2 lines

Patch from Jonas Koelker to fix a double free in magnetssolver.

------------------------------------------------------------------------
r8969 | simon | 2010-06-27 15:17:27 +0400 (, 27  2010) | 6 lines

Some minor fixes to the unfinished Pearl solver:
 - move critical correctness checks out of diagnostic ifdefs (ahem)
 - move declarations to before conditionally compiled code (we don't
   build in C99 mode round here)
 - tidy up an unsightly blank line while I'm here.

------------------------------------------------------------------------
r8966 | simon | 2010-05-31 02:48:31 +0400 (, 31  2010) | 3 lines

Some kernels don't like my #! line. Move the -w into a 'use
warnings;' to make it simpler.

------------------------------------------------------------------------
r8965 | simon | 2010-05-29 19:43:52 +0400 (, 29  2010) | 4 lines

Patch from Mark Wooding to add documentation of the new
draw_thick_line function, and also add some general thoughts on how
to draw puzzles' windows in an antialiasing-friendly way.

------------------------------------------------------------------------
r8964 | simon | 2010-05-29 19:43:50 +0400 (, 29  2010) | 4 lines

Patch from Mark Wooding to add antialiasing-safety in repeated
redrawing of inequality signs in Unequal (which are redrawn when
they change colour).

------------------------------------------------------------------------
r8963 | simon | 2010-05-29 19:43:48 +0400 (, 29  2010) | 5 lines

Patch from Mark Wooding to reorganise Loopy's redraw function to be
properly antialiasing-safe: all redraws are now done by clearing a
rectangle of the image, clipping to that rectangle, and redrawing
everything in it exactly once.

------------------------------------------------------------------------
r8962 | simon | 2010-05-29 19:43:46 +0400 (, 29  2010) | 9 lines

Patch from Mark Wooding to introduce a draw_thick_line() function in
the drawing API, for use by Loopy. It's optional: drawing.c will
construct an acceptable alternative using a filled polygon if the
front end doesn't provide it.

Net and Netslide previously had static functions called
draw_thick_line(), whose claim to the name is less justified and so
they've been renamed.

------------------------------------------------------------------------
r8961 | simon | 2010-05-29 19:43:42 +0400 (, 29  2010) | 5 lines

Patch from Mark Wooding to (optionally at compile time) use the
Cairo rendering library in place of GDK, which provides pretty
antialiased graphics much like we get on MacOS. Inertia and Untangle
are perhaps the two games most obviously improved by this.

------------------------------------------------------------------------
r8960 | simon | 2010-05-29 19:43:41 +0400 (, 29  2010) | 4 lines

Patch from Mark Wooding to disable GTK's internal double buffering,
which I didn't know about, but which is clearly a waste of effort
since we keep our own backing pixmap for the puzzle window.

------------------------------------------------------------------------
r8959 | simon | 2010-05-29 19:43:40 +0400 (, 29  2010) | 5 lines

Patch from Mark Wooding to use GTK stock items for standard 'OK',
'Yes' and 'No' buttons, which means they get the standard icons that
go on those button types. Also reorders yes/no boxes so that they're
the GNOME standard way round.

------------------------------------------------------------------------
r8957 | simon | 2010-05-29 17:44:12 +0400 (, 29  2010) | 5 lines

Make mkfiles.pl clean under 'perl -w'. Fixes one minor bug in the
output (a comment from Recipe mistakenly got into the Unix
makefile); more importantly, lets mkfiles.pl run in up-to-date Perls
(where implicit split to @_ is now obsolete).

------------------------------------------------------------------------
r8951 | simon | 2010-05-16 10:58:09 +0400 (, 16  2010) | 9 lines

Patch from Ben Hutchings to fix an error-checking goof: Keen
division clues were failing to light up as erroneous if the quotient
of the numbers in them came out right under rounded-down C integer
division (e.g. 2 and 5 would be accepted for a 2/ clue). Apparently
I copied the code that invents clues in the generator straight into
the solution checker, without remembering that the generator was
allowed to do it that way because exact divisibility had been
checked elsewhere.

------------------------------------------------------------------------
r8939 | simon | 2010-05-09 11:22:16 +0400 (, 09  2010) | 3 lines

A user points out that Signpost doesn't in fact use the numeric
keypad, so it shouldn't have the REQUIRE_NUMPAD flag.

------------------------------------------------------------------------
r8933 | simon | 2010-04-26 21:26:38 +0400 (, 26  2010) | 5 lines

Fix a build-breaking bug I introduced to the OS X makefile in r8931.
(Missed off the explicit -o from the compile lines constructing
version.{i386,ppc}.o, causing both to be compiled as version.o and
dependent build steps to fail.)

------------------------------------------------------------------------
r8932 | simon | 2010-04-25 18:57:43 +0400 (, 25  2010) | 2 lines

Add version2.def to the list of svn:ignored files.

------------------------------------------------------------------------
r8931 | simon | 2010-04-25 18:57:21 +0400 (, 25  2010) | 7 lines

Modification of a patch from Debian: eliminate the endless rebuilds
of basically unchanged binaries due to the compulsory rebuild of
version.o. version.o now depends normally on version2.def, which is
constructed using much the same if statements that version.o used to
use, except that it's not overwritten at all if its contents don't
need to change.

------------------------------------------------------------------------
r8930 | simon | 2010-04-25 18:57:20 +0400 (, 25  2010) | 9 lines

Patch idea from Debian, but modified considerably in implementation:
introduce a new colour in Slant (COL_FILLEDSQUARE) which is used for
the background of any grid square that has a diagonal line in it.
This makes it easier to spot the one square on a giant board you
forgot to fill in, but on the other hand I found it to look very
strange and disconcerting. So I've set the colour to be identical to
COL_BACKGROUND by default, and users who like the idea can enable it
by environment variable or by local patch.

------------------------------------------------------------------------
r8929 | simon | 2010-04-25 18:57:19 +0400 (, 25  2010) | 6 lines

Patch from Debian, to bring the use of the X selection/clipboard in
line with freedesktop.org. (This is relatively simple for Puzzles,
since it only writes to the clipboard and never reads it, so the
question of which selection to use when is most easily dealt with by
always writing to both.)

------------------------------------------------------------------------
r8924 | simon | 2010-04-18 19:07:54 +0400 (, 18  2010) | 3 lines

Wording tweaks inspired by (but not the same as) some in a Debian
downstream patch.

------------------------------------------------------------------------
r8923 | simon | 2010-04-18 19:07:52 +0400 (, 18  2010) | 3 lines

Patch from Ben Hutchings: explicitly initialise something which some
gccs complained about.

------------------------------------------------------------------------
r8922 | simon | 2010-04-17 17:27:15 +0400 (, 17  2010) | 3 lines

Fix incorrect uses of ctype.h (passing it uncast chars, or other
things potentially not in the range 0..255).

------------------------------------------------------------------------
r8921 | simon | 2010-04-17 17:27:12 +0400 (, 17  2010) | 3 lines

Fix from James H for an assertion failure during Signpost
generation. To reproduce, try 'signpost --generate 1 7x7#12345-162'.

------------------------------------------------------------------------
r8914 | simon | 2010-04-02 14:20:58 +0400 (, 02  2010) | 2 lines

Add '-v' option to patternsolver, to make it show its working.

------------------------------------------------------------------------
r8913 | simon | 2010-04-02 11:21:34 +0400 (, 02  2010) | 3 lines

Dylan O'Donnell reports that Signpost hangs on trying to generate a
2x2 puzzle. Rule it out in validate_params().

------------------------------------------------------------------------
r8906 | simon | 2010-03-21 17:30:49 +0300 (, 21  2010) | 4 lines

Chris Boyle reports an off-by-two error ('a Qui-Gon Jinx' :-) in
difficulty selection in Unequal's solver. I suspect I missed this
when I refactored latin.c and its callers.

------------------------------------------------------------------------
r8905 | simon | 2010-03-21 11:48:29 +0300 (, 21  2010) | 9 lines

Error highlighting bug in Bridges: when counting the number of extra
bridges that could go to an island, the game was not correctly
accounting for existing bridges in all circumstances.

(E.g. in 7x7m2:2a6a2a1g4a6c4i1a1h23c2b, connect the top right 1 to
the 2 left of it, and the 6 left of that correctly lights up red.
But now connect the 6 to the 6 below it, and it wrongly unlights
again.)

------------------------------------------------------------------------
r8887 | simon | 2010-02-24 22:30:03 +0300 (, 24  2010) | 2 lines

Another w/h transposition typo.

------------------------------------------------------------------------
r8886 | simon | 2010-02-24 21:06:59 +0300 (, 24  2010) | 3 lines

Typo affecting gameplay on grids wider than they are tall. (Clicking
in columns with x > h was being erroneously rejected.)

------------------------------------------------------------------------
r8882 | simon | 2010-02-23 02:14:46 +0300 (, 23  2010) | 6 lines

Fixes from James H to the numbering of squares, in particular:
 - sometimes two regions would get the same letter
 - immutable numbers could sometimes be modified
 - immutable numbers are now not flagged as errors when they clash
   (same as Solo's policy)

------------------------------------------------------------------------
r8873 | simon | 2010-02-18 21:12:12 +0300 (, 18  2010) | 5 lines

Fix build failure on MacOS by initialising a variable which was
reported as potentially-unused. (In fact, as far as I can tell, it's
only ever uninitialised in assertion-failing code paths, so not a
real bug.)

------------------------------------------------------------------------
r8872 | simon | 2010-02-17 22:15:04 +0300 (, 17  2010) | 4 lines

A proper fix from James H for the negative number issue: the
assertion I crudely commented out has now been replaced with code
that clearly shows what you did wrong in the failing situation.

------------------------------------------------------------------------
r8869 | jacob | 2010-02-17 05:37:40 +0300 (, 17  2010) | 2 lines

Typo fix (from Debian).

------------------------------------------------------------------------
r8868 | simon | 2010-02-17 00:49:17 +0300 (, 17  2010) | 2 lines

Capitalisation glitch.

------------------------------------------------------------------------
r8867 | simon | 2010-02-16 18:13:28 +0300 (, 16  2010) | 9 lines

'Fix' an assertion failure during play: accidentally connecting a
long chain to a square numbered so low that the start of the chain
would have to go into negative numbers should not crash the game,
particularly when it happens as a momentary in-passing illustration.

I've fixed it for the moment just by removing the assertion. There's
probably a better fix which causes something less strange to happen
to the display as a result.

------------------------------------------------------------------------
r8866 | simon | 2010-02-16 13:48:25 +0300 (, 16  2010) | 2 lines

Docs and comments fixes from James H.

------------------------------------------------------------------------
r8865 | simon | 2010-02-16 00:31:58 +0300 (, 16  2010) | 2 lines

Updates to the new-puzzle checklist, since the world has moved on.

------------------------------------------------------------------------
r8861 | simon | 2010-02-16 00:09:09 +0300 (, 16  2010) | 4 lines

New puzzle! Setting what might be a record for how long we've sat on
a puzzle before it was ready to commit, here is 'Signpost': a clone
of janko.at's "Arrow Path", by James Harvey.

------------------------------------------------------------------------
r8853 | simon | 2010-01-19 03:56:37 +0300 (, 19  2010) | 5 lines

Patch inspired by one from James H: remove spurious references to
$mw (it should only ever have been used in the Cygwin makefile), and
move the libraries to the end of the link line in the Unix makefile
for better portability.

------------------------------------------------------------------------
r8852 | simon | 2010-01-19 00:23:27 +0300 (, 19  2010) | 4 lines

Fix from James H: the shared code between drawing and printing
should use state->adjacent rather than ds->adjacent, because the
latter won't be initialised in printing mode.

------------------------------------------------------------------------
r8851 | simon | 2010-01-19 00:23:26 +0300 (, 19  2010) | 4 lines

Fix from James H: in printing mode, the shared code between drawing
and printing must avoid referring to stuff in the game_drawstate,
since the game_drawstate isn't a real one.

------------------------------------------------------------------------
r8850 | simon | 2010-01-19 00:23:25 +0300 (, 19  2010) | 2 lines

Memory leak fix from James H.

------------------------------------------------------------------------
r8845 | simon | 2010-01-17 04:05:55 +0300 (, 17  2010) | 3 lines

Patch from James H to fix a bug in which ambiguous puzzles would
occasionally be generated, e.g. by 8x8de#417341658689473 .

------------------------------------------------------------------------
r8844 | jacob | 2010-01-16 16:03:36 +0300 (, 16  2010) | 2 lines

Typo/formatting fixes for Magnets documentation.

------------------------------------------------------------------------
r8843 | simon | 2010-01-16 15:38:15 +0300 (, 16  2010) | 6 lines

Highlight the sides as well as the top of a tower when it's
selected. I think this is a more or less aesthetically neutral
change for the actual selection, but the selection code is reused to
draw the victory flash and that's greatly improved by not having the
tower sides remain unflashed.

------------------------------------------------------------------------
r8839 | simon | 2010-01-13 22:25:57 +0300 (, 13  2010) | 2 lines

Don't use payload strings directly as the format for printf.

------------------------------------------------------------------------
r8838 | simon | 2010-01-13 22:25:56 +0300 (, 13  2010) | 2 lines

Placate optimiser.

------------------------------------------------------------------------
r8837 | simon | 2010-01-13 22:19:37 +0300 (, 13  2010) | 2 lines

svn:ignore update.

------------------------------------------------------------------------
r8836 | simon | 2010-01-13 22:12:32 +0300 (, 13  2010) | 2 lines

New puzzle from James H: 'Magnets'.

------------------------------------------------------------------------
r8835 | simon | 2010-01-13 02:32:23 +0300 (, 13  2010) | 4 lines

Couple of small changes to Singles from James H which missed my main
commit: tweak the grid generation a bit, and fix the use of the
Solve function on a grid containing errors.

------------------------------------------------------------------------
r8834 | simon | 2010-01-13 02:32:22 +0300 (, 13  2010) | 3 lines

Patch from James H: make the Windows debugging output conditional on
an enabling environment variable.

------------------------------------------------------------------------
r8833 | simon | 2010-01-12 21:34:06 +0300 (, 12  2010) | 4 lines

Add a couple more checks to the 3d collision detection, without
which a click miles above the invisible RH surface of a tower would
sometimes select that tower.

------------------------------------------------------------------------
r8832 | jacob | 2010-01-12 01:46:02 +0300 (, 12  2010) | 2 lines

Corrections to Singles documentation, plus index terms.

------------------------------------------------------------------------
r8830 | simon | 2010-01-12 00:27:37 +0300 (, 12  2010) | 2 lines

Misspelled keyword.

------------------------------------------------------------------------
r8829 | simon | 2010-01-12 00:21:29 +0300 (, 12  2010) | 2 lines

svn:ignore update.

------------------------------------------------------------------------
r8828 | simon | 2010-01-12 00:21:07 +0300 (, 12  2010) | 5 lines

New puzzle from James Harvey: 'Singles', an implementation of
Hitori. One infrastructure change in the process: latin.c has
acquired a utility function to generate a latin rectangle rather
than a full square.

------------------------------------------------------------------------
r8827 | simon | 2010-01-11 23:32:55 +0300 (, 11  2010) | 6 lines

Retire the YTRANS and YUNTRANS macros in latin.[ch]. They were
introduced to mimic similar macros in solo.c, in case Solo ever
moved over to being based on the latin.c solver framework; but even
Solo has long since lost those macros, so latin.c has no need to
keep them.

------------------------------------------------------------------------
r8826 | simon | 2010-01-11 21:41:29 +0300 (, 11  2010) | 7 lines

The 3-D graphics in Towers need a corresponding change on the input
side: instead of locating a mouse click in whichever base grid
square contained the click location, we should check to see if a
tower protrudes on to that location from a neighbouring square. That
way, a click should reliably activate the tower that was actually
drawn under the mouse pointer.

------------------------------------------------------------------------
r8825 | simon | 2010-01-11 21:41:28 +0300 (, 11  2010) | 2 lines

Oops! Remove evidence of blatant clone-and-hack from Keen. :-)

------------------------------------------------------------------------
r8824 | simon | 2010-01-09 20:21:36 +0300 (, 09  2010) | 3 lines

Oops. Uncomment the difficulty exceptions! (Also add another
constraint in validate_params.)

------------------------------------------------------------------------
r8823 | jacob | 2010-01-08 15:25:44 +0300 (, 08  2010) | 2 lines

New year, new puzzle.

------------------------------------------------------------------------
r8822 | jacob | 2010-01-07 23:50:49 +0300 (, 07  2010) | 2 lines

Fix formatting.

------------------------------------------------------------------------
r8821 | simon | 2010-01-07 22:09:58 +0300 (, 07  2010) | 2 lines

Crop the Towers icon more sensibly (i.e. at all).

------------------------------------------------------------------------
r8818 | simon | 2010-01-07 21:42:21 +0300 (, 07  2010) | 2 lines

Update svn:ignore.

------------------------------------------------------------------------
r8817 | simon | 2010-01-07 21:42:01 +0300 (, 07  2010) | 6 lines

Upgrade the graphics in Towers to include a thematically appropriate
3D effect. (I only committed it without so that I could preserve a
record of how the code looked before I added it.) The 3D effect can
be disabled by setting TOWERS_2D in the environment, should anybody
seriously dislike it.

------------------------------------------------------------------------
r8816 | simon | 2010-01-07 21:42:00 +0300 (, 07  2010) | 4 lines

New puzzle, again using the revised latin.c: 'Towers', a clone of a
latin-square puzzle which I've seen described by several names but
the most common is 'Skyscrapers'.

------------------------------------------------------------------------
r8815 | simon | 2010-01-07 21:15:09 +0300 (, 07  2010) | 2 lines

Memory leak fix from James H.

------------------------------------------------------------------------
r8813 | simon | 2010-01-06 02:40:42 +0300 (, 06  2010) | 2 lines

Proof that check_errors() is sufficient.

------------------------------------------------------------------------
r8812 | simon | 2010-01-06 02:40:41 +0300 (, 06  2010) | 4 lines

Refer to group elements by letters instead of numbers, in keeping
with usual abstract group notation. In puzzles with a clear
identity, it's called e.

------------------------------------------------------------------------
r8811 | simon | 2010-01-06 02:40:40 +0300 (, 06  2010) | 3 lines

Add a facility in the latin.c solver diagnostics to allow a puzzle
to call the digit values by custom names.

------------------------------------------------------------------------
r8810 | simon | 2010-01-05 22:52:52 +0300 (, 05  2010) | 5 lines

Add an even more evil (!) game mode, in which it's not made
immediately obvious which element of the group is the identity - at
least two elements including the identity have their rows and
columns completely blanked.

------------------------------------------------------------------------
r8809 | simon | 2010-01-05 21:51:42 +0300 (, 05  2010) | 3 lines

Yikes! Fix a misaimed 'sizeof' which I only got away with because
ints and pointers are usually the same size.

------------------------------------------------------------------------
r8808 | simon | 2010-01-05 21:26:55 +0300 (, 05  2010) | 2 lines

A user asked for the < signs in Unequal to be bolder.

------------------------------------------------------------------------
r8807 | simon | 2010-01-05 21:26:44 +0300 (, 05  2010) | 4 lines

Missing piece of code I should have cribbed from Solo: we have to
lay out large numbers of pencil marks differently in a square
containing a clue.

------------------------------------------------------------------------
r8806 | simon | 2010-01-05 21:26:42 +0300 (, 05  2010) | 2 lines

Another 16-bit-cleanliness fix (and for once I spotted it before James!)

------------------------------------------------------------------------
r8805 | simon | 2010-01-04 22:14:35 +0300 (, 04  2010) | 4 lines

Memory leak fix from Tiago Dionizio: whenever we free the midend's
collection of game states, we should also free the move strings from
which they were constructed.

------------------------------------------------------------------------
r8803 | simon | 2010-01-04 21:55:56 +0300 (, 04  2010) | 2 lines

16-bit cleanliness patch from James H.

------------------------------------------------------------------------
r8802 | simon | 2010-01-01 23:06:34 +0300 (, 01  2010) | 4 lines

For my own use in local Windows builds of the 'unfinished' puzzles,
add an include directory to the Windows makefile so that source
files in subdirectories can find the main headers.

------------------------------------------------------------------------
r8801 | simon | 2010-01-01 22:41:59 +0300 (, 01  2010) | 2 lines

Couple of missing 'static's.

------------------------------------------------------------------------
r8800 | simon | 2009-12-30 19:53:36 +0300 (, 30  2009) | 15 lines

New puzzle in 'unfinished'. Essentially, Sudoku for group theorists:
you are given a partially specified Cayley table of a small finite
group, and must fill in all the missing entries using both Sudoku-
style deductions (minus the square block constraint) and the group
axioms. I've just thrown it together in about five hours by cloning-
and-hacking from Keen, as much as anything else to demonstrate that
the new latin.c interface really does make it extremely easy to
write new Latin square puzzles.

It's not really _unfinished_, as such, but it is just too esoteric
(not to mention difficult) for me to feel entirely comfortable with
adding it to the main puzzle collection. I can't bring myself to
throw it away, though, and who knows - perhaps a university maths
department might find it a useful teaching tool :-)

------------------------------------------------------------------------
r8798 | simon | 2009-12-27 22:18:22 +0300 (, 27  2009) | 4 lines

Fix bug causing array overrun. Only seemed to be showing a symptom
on Windows, presumably because the data after the array was harmless
elsewhere.

------------------------------------------------------------------------
r8797 | simon | 2009-12-27 13:03:13 +0300 (, 27  2009) | 2 lines

Add keen and keensolver to svn:ignore.

------------------------------------------------------------------------
r8796 | simon | 2009-12-27 13:01:23 +0300 (, 27  2009) | 2 lines

New puzzle! 'Keen', a clone of KenKen.

------------------------------------------------------------------------
r8795 | simon | 2009-12-27 13:01:20 +0300 (, 27  2009) | 5 lines

Normalise Unequal (and latin.c) so that solver diagnostics start
their coordinate from 1 rather than 0, for consistency with Solo.
(My geek instincts would rather work from 0, but I've generally
found that puzzle users sending me email tend to prefer 1.)

------------------------------------------------------------------------
r8794 | simon | 2009-12-27 13:01:18 +0300 (, 27  2009) | 4 lines

I've never trusted common variables. Take those bare ints out of
latin.h and put them in latin.c with 'extern' declarations in the
header.

------------------------------------------------------------------------
r8793 | simon | 2009-12-27 13:01:16 +0300 (, 27  2009) | 7 lines

Introduce, and implement as usefully as I can in all front ends, a
new function in the drawing API which permits the display of text
from outside basic ASCII. A fallback mechanism is provided so that
puzzles can give a list of strings they'd like to display in order
of preference and the system will return the best one it can manage;
puzzles are required to cope with ASCII-only front ends.

------------------------------------------------------------------------
r8792 | simon | 2009-12-27 13:01:11 +0300 (, 27  2009) | 6 lines

Tweak the semantics of dsf_merge() so that the canonical element of
any equivalence class is always the element with the smallest index.
This is slower (the previous behaviour, suggested by Jonas Koelker,
was to choose the new root element to maximise performance), but
still more than acceptably fast and more useful.

------------------------------------------------------------------------
r8791 | simon | 2009-12-27 13:01:10 +0300 (, 27  2009) | 8 lines

Refactor latin.c to make it easier to reuse. Instead of client
programs having to clone the latin_solver() function and insert
their own extra deduction routines, they can now just _call_
latin_solver with enough parameters to let it fit its own deductions
into their difficulty framework and call a set of provided function
pointers to do user deductions. Modified Unequal to work in the new
world, of course.

------------------------------------------------------------------------
r8790 | simon | 2009-12-27 13:01:09 +0300 (, 27  2009) | 7 lines

New mode for Unequal, from James H. In this mode, called 'Adjacent',
the < and > clues are replaced by bars separating every pair of
squares whose contents differ by exactly 1. Unlike standard Unequal,
which presents only a subset of the available clues, in Adjacent the
clues are _all_ present, so you can deduce from the absence of a bar
that the two numbers it would separate are _not_ consecutive.

------------------------------------------------------------------------
r8789 | simon | 2009-12-23 14:34:25 +0300 (, 23  2009) | 2 lines

latin_generate_quick is long gone, so remove it from the header file.

------------------------------------------------------------------------
r8788 | simon | 2009-12-22 19:47:42 +0300 (, 22  2009) | 3 lines

Keyboard control for Dominosa (patch largely due to James H, though
with considerable meddling from me).

------------------------------------------------------------------------
r8786 | simon | 2009-12-20 13:01:57 +0300 (, 20  2009) | 7 lines

Jonas Koelker points out that the backspace key didn't work in GTK
Guess, because Guess expected ^H whereas GTK generated ^?. Other
puzzles that use Backspace do it by being prepared to see either,
which seems wasteful. Now the midend normalises both into ^H, so
front ends can generate whichever they like while puzzles can
safely just look for ^H.

------------------------------------------------------------------------
r8785 | simon | 2009-12-17 21:20:32 +0300 (, 17  2009) | 2 lines

Minor bug fixes from James Harvey.

------------------------------------------------------------------------
r8784 | simon | 2009-12-17 21:16:42 +0300 (, 17  2009) | 7 lines

Patches from Frode Austvik to modify the effects of the mouse
buttons in several games if STYLUS_BASED is defined: in games where
you can set a puzzle element to 'on', 'off' or 'not yet set', when
it's hard to mimic a second mouse button, it's better to have the
one 'button' cycle between all three states rather than from 'on'
back to 'unset'.

------------------------------------------------------------------------
r8783 | simon | 2009-12-17 21:12:18 +0300 (, 17  2009) | 5 lines

Patch from Frode Austvik to tinker with the GTK interface if
compiling gtk.c with STYLUS_BASED defined: most notably, it provides
a row of numeric 'keys' made of GTK button widgets for puzzles that
want a numeric keypad.

------------------------------------------------------------------------
r8782 | simon | 2009-12-17 20:55:42 +0300 (, 17  2009) | 3 lines

Patch from Frode Austvik to permit passing CFLAGS in to the Unix
makefile.

------------------------------------------------------------------------
r8780 | jacob | 2009-12-13 15:47:10 +0300 (, 13  2009) | 2 lines

Another wording tweak from Helge Kreutzmann.

------------------------------------------------------------------------
r8750 | simon | 2009-11-17 00:21:00 +0300 (, 17  2009) | 3 lines

Fix for the grid generation in the presence of particularly strange
grid types.

------------------------------------------------------------------------
r8745 | simon | 2009-11-10 22:11:03 +0300 (, 10  2009) | 4 lines

Add a precautionary pair of initialisations to placate optimisers,
and asserts to check that the preinitialised values are never
actually used.

------------------------------------------------------------------------
r8736 | jacob | 2009-11-05 17:09:04 +0300 (, 05  2009) | 2 lines

Remove ASCII-art arrows. Missing \dash (Debian bug #522439).

------------------------------------------------------------------------
r8735 | jacob | 2009-11-04 16:19:39 +0300 (, 04  2009) | 2 lines

Beat up on Black Box docs, after Debian bug #548472.

------------------------------------------------------------------------
r8734 | jacob | 2009-11-04 15:06:32 +0300 (, 04  2009) | 2 lines

Typo fixes from Debian bug#554341.

------------------------------------------------------------------------
r8692 | simon | 2009-10-13 21:09:42 +0400 (, 13  2009) | 4 lines

Single mouse clicks to toggle individual grid edges stopped working
in r8414 as a side effect of reorganisation in interpret_move().
Reinstate them.

------------------------------------------------------------------------
r8655 | simon | 2009-09-16 16:57:07 +0400 (, 16  2009) | 4 lines

Add a couple of missing checks in validate_desc(), without which
bogus game IDs were getting as far as new_game() and failing
assertions.

------------------------------------------------------------------------
r8654 | simon | 2009-09-16 15:06:02 +0400 (, 16  2009) | 2 lines

Minor rewording and typo-correction.

------------------------------------------------------------------------
r8653 | simon | 2009-09-16 14:57:11 +0400 (, 16  2009) | 4 lines

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.

------------------------------------------------------------------------
r8647 | simon | 2009-09-13 18:43:21 +0400 (, 13  2009) | 4 lines

Error-highlighted trees look nicer with a different-coloured trunk.
Also added a comment worrying about the universality of my error
highlighting mechanism.

------------------------------------------------------------------------
r8646 | simon | 2009-09-13 17:08:34 +0400 (, 13  2009) | 4 lines

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.

------------------------------------------------------------------------
r8645 | simon | 2009-09-12 16:54:49 +0400 (, 12  2009) | 2 lines

Tweak to the promptness of error highlighting display.

------------------------------------------------------------------------
r8644 | simon | 2009-09-12 16:30:43 +0400 (, 12  2009) | 2 lines

About time I got round to this: error highlighting for Tents.

------------------------------------------------------------------------
r8643 | simon | 2009-09-09 22:22:14 +0400 (, 09  2009) | 2 lines

Fix width/height braino introduced in r5844.

------------------------------------------------------------------------
r8634 | simon | 2009-08-28 21:43:44 +0400 (, 28  2009) | 2 lines

Add execute permission to the .exe files inside the zip file.

------------------------------------------------------------------------
r8605 | simon | 2009-07-02 02:01:21 +0400 (, 02  2009) | 2 lines

More defensive-coding fixes from James H.

------------------------------------------------------------------------
r8601 | simon | 2009-06-21 17:49:09 +0400 (, 21  2009) | 5 lines

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.

------------------------------------------------------------------------
r8600 | simon | 2009-06-21 17:39:54 +0400 (, 21  2009) | 5 lines

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!

------------------------------------------------------------------------
r8599 | simon | 2009-06-21 17:34:50 +0400 (, 21  2009) | 9 lines

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.

------------------------------------------------------------------------
r8598 | simon | 2009-06-21 17:28:43 +0400 (, 21  2009) | 3 lines

Patch from Mark Wooding: one-pixel fix to the alignment of the
bottom and right edges of the Tents keyboard cursor.

------------------------------------------------------------------------
r8597 | simon | 2009-06-21 17:24:48 +0400 (, 21  2009) | 9 lines

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.)

------------------------------------------------------------------------
r8596 | simon | 2009-06-18 00:01:45 +0400 (, 18  2009) | 2 lines

Memory management and other fixes from James H.

------------------------------------------------------------------------
r8541 | simon | 2009-04-30 21:56:56 +0400 (, 30  2009) | 14 lines

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".

------------------------------------------------------------------------
r8540 | simon | 2009-04-30 03:11:10 +0400 (, 30  2009) | 4 lines

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.

------------------------------------------------------------------------
r8494 | jacob | 2009-03-20 02:32:30 +0300 (, 20  2009) | 2 lines

It's been a new year for some time now.

------------------------------------------------------------------------
r8489 | simon | 2009-03-03 02:32:43 +0300 (, 03  2009) | 2 lines

Patch from James H to provide 16-bit-int cleanliness in Killer Solo.

------------------------------------------------------------------------
r8488 | simon | 2009-03-02 22:45:59 +0300 (, 02  2009) | 4 lines

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.

------------------------------------------------------------------------
r8486 | jacob | 2009-03-01 16:51:32 +0300 (, 01  2009) | 2 lines

Make menus accessible from the keyboard in the Gtk front-end.

------------------------------------------------------------------------
r8463 | simon | 2009-02-24 10:49:01 +0300 (, 24  2009) | 3 lines

Fix cosmetic glitch in the interaction between Killer and Jigsaw
modes.

------------------------------------------------------------------------
r8459 | jacob | 2009-02-23 20:42:50 +0300 (, 23  2009) | 2 lines

Make icon building cope with Solo's increased default tilesize as of r8455.

------------------------------------------------------------------------
r8458 | jacob | 2009-02-22 15:57:20 +0300 (, 22  2009) | 2 lines

Fix duplicate keyword.

------------------------------------------------------------------------
r8455 | simon | 2009-02-22 15:16:54 +0300 (, 22  2009) | 5 lines

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.

------------------------------------------------------------------------
r8453 | simon | 2009-02-22 15:05:38 +0300 (, 22  2009) | 3 lines

Introduce some infrastructure to permit games' print functions to
draw dotted lines. No puzzle yet uses this, but one's about to.

------------------------------------------------------------------------
r8452 | simon | 2009-02-22 15:02:40 +0300 (, 22  2009) | 7 lines

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.

------------------------------------------------------------------------
r8446 | simon | 2009-02-05 22:29:26 +0300 (, 05  2009) | 2 lines

Keyboard control patch for Bridges, from James H.

------------------------------------------------------------------------
r8444 | simon | 2009-02-05 22:25:44 +0300 (, 05  2009) | 5 lines

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.

------------------------------------------------------------------------
r8439 | simon | 2009-01-28 21:28:41 +0300 (, 28  2009) | 2 lines

Keyboard control patch for Black Box, from James H.

------------------------------------------------------------------------
r8438 | simon | 2009-01-28 21:27:10 +0300 (, 28  2009) | 2 lines

Keyboard control patch for Twiddle, from James H.

------------------------------------------------------------------------
r8435 | simon | 2009-01-27 21:30:46 +0300 (, 27  2009) | 2 lines

Keyboard control patch for Pattern, from James H.

------------------------------------------------------------------------
r8434 | simon | 2009-01-27 21:26:10 +0300 (, 27  2009) | 2 lines

Keyboard control for Map, from James H.

------------------------------------------------------------------------
r8433 | simon | 2009-01-27 01:28:17 +0300 (, 27  2009) | 14 lines

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.)

------------------------------------------------------------------------
r8432 | simon | 2009-01-26 22:14:44 +0300 (, 26  2009) | 3 lines

Patch from James H to add keyboard control in Sixteen and Netslide
(and also belatedly document the keyboard support in Unequal).

------------------------------------------------------------------------
r8431 | simon | 2009-01-26 22:11:34 +0300 (, 26  2009) | 4 lines

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.

------------------------------------------------------------------------
r8430 | simon | 2009-01-24 20:58:42 +0300 (, 24  2009) | 5 lines

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*)

------------------------------------------------------------------------
r8428 | simon | 2009-01-22 22:16:37 +0300 (, 22  2009) | 2 lines

Update the ignores.

------------------------------------------------------------------------
r8419 | simon | 2009-01-20 21:28:28 +0300 (, 20  2009) | 2 lines

Keyboard control patch for Pegs, from James H.

------------------------------------------------------------------------
r8418 | simon | 2009-01-19 21:38:29 +0300 (, 19  2009) | 2 lines

Keyboard control patch for Solo, from James H.

------------------------------------------------------------------------
r8417 | simon | 2009-01-16 21:52:18 +0300 (, 16  2009) | 2 lines

Keyboard control patch for Slant, from James H.

------------------------------------------------------------------------
r8416 | simon | 2009-01-16 21:50:22 +0300 (, 16  2009) | 2 lines

Keyboard cursor support for Tents, from James H.

------------------------------------------------------------------------
r8415 | simon | 2009-01-16 21:45:01 +0300 (, 16  2009) | 2 lines

r8396 introduced midend_tilesize(). Document it.

------------------------------------------------------------------------
r8414 | simon | 2009-01-15 21:20:02 +0300 (, 15  2009) | 2 lines

Keyboard cursor support for Rectangles, from James H.

------------------------------------------------------------------------
r8413 | simon | 2009-01-15 21:18:21 +0300 (, 15  2009) | 2 lines

Keyboard cursor support in Galaxies, by James H.

------------------------------------------------------------------------
r8412 | simon | 2009-01-14 23:44:25 +0300 (, 14  2009) | 2 lines

Keyboard interface for Filling, from James H.

------------------------------------------------------------------------
r8409 | simon | 2009-01-12 23:30:12 +0300 (, 12  2009) | 3 lines

Patch from James H to fix some off-by-one errors in Guess's click
rectangle checking, preventing array bounds violation.

------------------------------------------------------------------------
r8408 | simon | 2009-01-12 23:23:56 +0300 (, 12  2009) | 4 lines

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.

------------------------------------------------------------------------
r8402 | simon | 2009-01-08 21:28:32 +0300 (, 08  2009) | 4 lines

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.)

------------------------------------------------------------------------
r8398 | simon | 2009-01-08 02:07:11 +0300 (, 08  2009) | 6 lines

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.

------------------------------------------------------------------------
r8397 | simon | 2009-01-08 00:55:21 +0300 (, 08  2009) | 5 lines

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.

------------------------------------------------------------------------
r8396 | simon | 2009-01-07 02:26:18 +0300 (, 07  2009) | 5 lines

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.)

------------------------------------------------------------------------
r8395 | simon | 2009-01-07 02:21:42 +0300 (, 07  2009) | 2 lines

Bring the unfinished .R files into line with the current conventions.

------------------------------------------------------------------------
r8373 | simon | 2008-12-12 22:49:05 +0300 (, 12  2008) | 3 lines

Don't ignore the return code of fwrite(). (Slight modification of a
patch from Phil Bordelon.)

------------------------------------------------------------------------
r8365 | simon | 2008-12-02 02:04:17 +0300 (, 02  2008) | 5 lines

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!

------------------------------------------------------------------------
r8352 | simon | 2008-11-29 16:51:36 +0300 (, 29  2008) | 6 lines

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.

------------------------------------------------------------------------
r8351 | simon | 2008-11-29 11:50:50 +0300 (, 29  2008) | 6 lines

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.

------------------------------------------------------------------------
r8342 | simon | 2008-11-28 22:33:40 +0300 (, 28  2008) | 3 lines

Fix parenthesis problem in Light Up solver. Should fix Debian bug
#505359.

------------------------------------------------------------------------
r8340 | simon | 2008-11-28 21:33:39 +0300 (, 28  2008) | 3 lines

Let's have some more presets in here: 3x3 is much _too_ short and
easy compared to 6x6.

------------------------------------------------------------------------
r8301 | simon | 2008-11-16 18:47:55 +0300 (, 16  2008) | 3 lines

Patch from Lee Dowling to implement mouse control in Sokoban, along
pretty much the same lines as Cube and Inertia.

------------------------------------------------------------------------
r8300 | simon | 2008-11-16 18:42:32 +0300 (, 16  2008) | 3 lines

Take out some lurking "nullgame" holdovers from unfinished puzzle
source files, in case they cause trouble. Spotted by Lee Dowling.

------------------------------------------------------------------------
r8299 | simon | 2008-11-16 18:37:58 +0300 (, 16  2008) | 5 lines

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).

------------------------------------------------------------------------
r8298 | simon | 2008-11-16 18:28:28 +0300 (, 16  2008) | 15 lines

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.

------------------------------------------------------------------------
r8278 | simon | 2008-11-05 02:02:07 +0300 (, 05  2008) | 2 lines

Check return values from fwrite when saving files.

------------------------------------------------------------------------
r8277 | simon | 2008-11-05 00:39:59 +0300 (, 05  2008) | 5 lines

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.

------------------------------------------------------------------------
r8259 | simon | 2008-11-02 17:29:41 +0300 (, 02  2008) | 4 lines

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

------------------------------------------------------------------------
r8200 | jacob | 2008-10-05 16:22:37 +0400 (, 05  2008) | 5 lines

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.

------------------------------------------------------------------------
r8199 | jacob | 2008-10-05 01:49:44 +0400 (, 05  2008) | 2 lines

Remove strange punctuation.

------------------------------------------------------------------------
r8192 | simon | 2008-09-19 11:31:52 +0400 (, 19  2008) | 3 lines

Cut-and-paste error which was preventing any drop-down list in the
custom game configuration code from working in the Java applets.

------------------------------------------------------------------------
r8191 | simon | 2008-09-18 22:19:55 +0400 (, 18  2008) | 10 lines

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.)

------------------------------------------------------------------------
r8190 | simon | 2008-09-18 19:33:13 +0400 (, 18  2008) | 2 lines

Patch from Lambros implementing error highlighting in Loopy.

------------------------------------------------------------------------
r8187 | simon | 2008-09-17 20:43:36 +0400 (, 17  2008) | 17 lines

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.)

------------------------------------------------------------------------
r8186 | jacob | 2008-09-17 03:51:57 +0400 (, 17  2008) | 3 lines

Cosmetic: fix mismatch between game_compute_size() and game_redraw()
(was causing unwanted "drop-shadow" type effect).

------------------------------------------------------------------------
r8181 | simon | 2008-09-14 12:52:59 +0400 (, 14  2008) | 4 lines

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.

------------------------------------------------------------------------
r8180 | simon | 2008-09-13 23:21:53 +0400 (, 13  2008) | 2 lines

Typo spotted by James H.

------------------------------------------------------------------------
r8179 | simon | 2008-09-13 23:18:42 +0400 (, 13  2008) | 3 lines

Oops, left this out of r8178: having defined COMBINED everywhere in
the puzzles, we can now remove it from the OS X makefile section.

------------------------------------------------------------------------
r8178 | simon | 2008-09-13 23:17:26 +0400 (, 13  2008) | 8 lines

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.

------------------------------------------------------------------------
r8177 | simon | 2008-09-13 22:29:20 +0400 (, 13  2008) | 7 lines

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.)

------------------------------------------------------------------------
r8176 | simon | 2008-09-13 22:26:53 +0400 (, 13  2008) | 3 lines

Patch from James H to centralise some generally useful cursor-
handling functionality into misc.c.

------------------------------------------------------------------------
r8175 | simon | 2008-09-13 22:25:19 +0400 (, 13  2008) | 4 lines

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.

------------------------------------------------------------------------
r8174 | simon | 2008-09-11 01:44:23 +0400 (, 11  2008) | 2 lines

Patch from James H to make new-Loopy port more easily.

------------------------------------------------------------------------
r8167 | simon | 2008-09-07 14:02:40 +0400 (, 07  2008) | 4 lines

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.

------------------------------------------------------------------------
r8166 | simon | 2008-09-07 12:35:52 +0400 (, 07  2008) | 6 lines

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.

------------------------------------------------------------------------
r8165 | simon | 2008-09-07 01:24:21 +0400 (, 07  2008) | 2 lines

New Loopy save file, compatible with the new Loopy.

------------------------------------------------------------------------
r8164 | simon | 2008-09-06 21:38:43 +0400 (, 06  2008) | 3 lines

Nearly forgot: Lambros definitely deserves a place in the copyright
statement!

------------------------------------------------------------------------
r8163 | simon | 2008-09-06 21:33:04 +0400 (, 06  2008) | 3 lines

Don't call changed_preset() until after we've initialised
fe->copy_menu_item.

------------------------------------------------------------------------
r8162 | simon | 2008-09-06 19:19:47 +0400 (, 06  2008) | 8 lines

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.

------------------------------------------------------------------------
r8161 | simon | 2008-09-06 13:27:56 +0400 (, 06  2008) | 19 lines

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.

------------------------------------------------------------------------
r8149 | simon | 2008-08-18 22:01:35 +0400 (, 18  2008) | 2 lines

Oh, and some more ignore properties, oops.

------------------------------------------------------------------------
r8148 | simon | 2008-08-18 22:00:33 +0400 (, 18  2008) | 3 lines

Extra ignore properties for the dual-architecture OS X build, which
I've managed to go a fair while without realising the need for.

------------------------------------------------------------------------
r8108 | simon | 2008-07-06 02:07:35 +0400 (, 06  2008) | 3 lines

Correction from James H: sqrt(0) shouldn't occur any more than
sqrt(1) should.

------------------------------------------------------------------------
r8107 | simon | 2008-07-05 19:40:43 +0400 (, 05  2008) | 2 lines

More operations and bug fixes from James H.

------------------------------------------------------------------------
r8106 | simon | 2008-07-05 17:32:28 +0400 (, 05  2008) | 2 lines

Remove rogue diagnostic.

------------------------------------------------------------------------
r8105 | simon | 2008-07-05 17:31:59 +0400 (, 05  2008) | 4 lines

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".

------------------------------------------------------------------------
r8096 | simon | 2008-06-27 21:28:32 +0400 (, 27  2008) | 4 lines

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.

------------------------------------------------------------------------
r8095 | simon | 2008-06-26 23:09:07 +0400 (, 26  2008) | 6 lines

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.

------------------------------------------------------------------------
r8094 | simon | 2008-06-26 23:07:44 +0400 (, 26  2008) | 7 lines

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).

------------------------------------------------------------------------
r8092 | simon | 2008-06-25 00:58:35 +0400 (, 25  2008) | 4 lines

James H has helpfully provided yet more silly operators for the -A
mode. I think some user-defined ruleset configuration options are
now required...

------------------------------------------------------------------------
r8091 | simon | 2008-06-23 21:34:56 +0400 (, 23  2008) | 2 lines

An option to enable a debugging mode for the BFS.

------------------------------------------------------------------------
r8064 | simon | 2008-06-11 00:35:17 +0400 (, 11  2008) | 3 lines

Michael Schierl's patch to compile the puzzles as Java applets using
NestedVM. Wow!

------------------------------------------------------------------------
r8062 | simon | 2008-06-10 21:24:09 +0400 (, 10  2008) | 3 lines

Just noticed that the return value of midend_process_key() wasn't
documented.

------------------------------------------------------------------------
r8061 | simon | 2008-06-09 22:28:03 +0400 (, 09  2008) | 4 lines

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.

------------------------------------------------------------------------
r7989 | simon | 2008-04-14 15:32:06 +0400 (, 14  2008) | 4 lines

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.

------------------------------------------------------------------------
r7983 | simon | 2008-04-10 15:11:33 +0400 (, 10  2008) | 12 lines

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.

------------------------------------------------------------------------
r7982 | simon | 2008-04-09 18:57:20 +0400 (, 09  2008) | 3 lines

Implement tick marks in the Type menu on Windows. Now all my front
ends have got them.

------------------------------------------------------------------------
r7981 | simon | 2008-04-09 18:36:08 +0400 (, 09  2008) | 2 lines

Implement tick marks in the Type menu on OS X.

------------------------------------------------------------------------
r7980 | simon | 2008-04-08 20:25:39 +0400 (, 08  2008) | 7 lines

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.

------------------------------------------------------------------------
r7979 | simon | 2008-04-08 14:30:18 +0400 (, 08  2008) | 3 lines

Having got Jigsaw mode generation working at reasonable speed, we
can now productise it.

------------------------------------------------------------------------
r7978 | simon | 2008-04-08 13:36:33 +0400 (, 08  2008) | 12 lines

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.

------------------------------------------------------------------------
r7977 | simon | 2008-04-07 21:16:08 +0400 (, 07  2008) | 3 lines

Ahem. Apparently forgot to compile-test after that one last tiny
change.

------------------------------------------------------------------------
r7976 | simon | 2008-04-07 21:13:29 +0400 (, 07  2008) | 4 lines

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.

------------------------------------------------------------------------
r7975 | simon | 2008-04-07 21:12:21 +0400 (, 07  2008) | 5 lines

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.)

------------------------------------------------------------------------
r7974 | simon | 2008-04-07 19:56:42 +0400 (, 07  2008) | 23 lines

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.

------------------------------------------------------------------------
r7932 | simon | 2008-03-20 12:18:26 +0300 (, 20  2008) | 7 lines

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.

------------------------------------------------------------------------
r7931 | simon | 2008-03-20 03:19:27 +0300 (, 20  2008) | 3 lines

I _think_, after some fairly random experimentation, that this ought
to fix the weird blacked-out text in the xvfb-built screenshots.

------------------------------------------------------------------------
r7916 | simon | 2008-03-11 20:59:38 +0300 (, 11  2008) | 20 lines

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.)

------------------------------------------------------------------------
r7849 | jacob | 2008-02-10 21:43:29 +0300 (, 10  2008) | 7 lines

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.)

------------------------------------------------------------------------
r7848 | jacob | 2008-02-10 20:12:49 +0300 (, 10  2008) | 2 lines

It's another new year.

------------------------------------------------------------------------
r7836 | simon | 2008-01-15 21:04:13 +0300 (, 15  2008) | 2 lines

Syntactic fixes by Zach Wily to make the OS X build work under 10.5.

------------------------------------------------------------------------
r7817 | simon | 2007-12-16 00:09:45 +0300 (, 16  2007) | 3 lines

64-bit cleanliness: we were already carefully using a uint32 type in
the SHA code, but it wasn't correctly defined!

------------------------------------------------------------------------
r7703 | simon | 2007-08-25 21:46:13 +0400 (, 25  2007) | 3 lines

A rigorous proof. Totally unimportant to the code, but I didn't want
to lose it :-)

------------------------------------------------------------------------
r7702 | simon | 2007-08-25 19:50:33 +0400 (, 25  2007) | 2 lines

Fix an inaccurate comment.

------------------------------------------------------------------------
r7701 | simon | 2007-08-25 19:32:41 +0400 (, 25  2007) | 6 lines

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.

------------------------------------------------------------------------
r7700 | simon | 2007-08-25 18:10:49 +0400 (, 25  2007) | 6 lines

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).

------------------------------------------------------------------------
r7694 | simon | 2007-08-18 17:32:56 +0400 (, 18  2007) | 2 lines

Ahem. Finishing writing the comment _before_ checkin is generally sensible.

------------------------------------------------------------------------
r7693 | simon | 2007-08-18 17:30:13 +0400 (, 18  2007) | 7 lines

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.

------------------------------------------------------------------------
r7691 | simon | 2007-08-18 15:19:29 +0400 (, 18  2007) | 2 lines

Better test-mode diagnostics.

------------------------------------------------------------------------
r7690 | simon | 2007-08-18 14:07:29 +0400 (, 18  2007) | 5 lines

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'.

------------------------------------------------------------------------
r7656 | simon | 2007-07-31 21:04:20 +0400 (, 31  2007) | 9 lines

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.

------------------------------------------------------------------------
r7636 | simon | 2007-07-05 22:57:50 +0400 (, 05  2007) | 5 lines

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.

------------------------------------------------------------------------
r7625 | simon | 2007-06-29 13:45:44 +0400 (, 29  2007) | 2 lines

Optimiser placation.

------------------------------------------------------------------------
r7601 | simon | 2007-05-20 18:28:48 +0400 (, 20  2007) | 2 lines

Updates and improvements from Jonas Koelker.

------------------------------------------------------------------------
r7600 | simon | 2007-05-19 10:16:24 +0400 (, 19  2007) | 2 lines

Left puzzles.rc2 out of the tarball. Oops.

------------------------------------------------------------------------
r7574 | simon | 2007-05-12 17:13:39 +0400 (, 12  2007) | 2 lines

More forgiving selection of dragging targets.

------------------------------------------------------------------------
r7573 | simon | 2007-05-12 15:51:39 +0400 (, 12  2007) | 3 lines

Graphics tweak: make the top-right and bottom-left corners of
everything look nicer.

------------------------------------------------------------------------
r7572 | simon | 2007-05-12 14:26:22 +0400 (, 12  2007) | 2 lines

In-game user interface to the solver.

------------------------------------------------------------------------
r7571 | simon | 2007-05-12 12:26:58 +0400 (, 12  2007) | 3 lines

Fix tiny memory leak if you pressed Solve while part way through an
existing solution path.

------------------------------------------------------------------------
r7570 | simon | 2007-05-12 12:14:37 +0400 (, 12  2007) | 3 lines

Remove the check for disconnected pieces; it's over-general and
triggers on a perfectly connected piece shaped like an inverted T.

------------------------------------------------------------------------
r7567 | simon | 2007-05-10 15:10:14 +0400 (, 10  2007) | 3 lines

noicon.rc was missing from the Unix source archive, which caused a
re-run of mkfiles.pl to fail.

------------------------------------------------------------------------
r7558 | simon | 2007-05-07 23:36:19 +0400 (, 07  2007) | 2 lines

Stand-alone slidesolver.

------------------------------------------------------------------------
r7554 | simon | 2007-05-07 23:08:52 +0400 (, 07  2007) | 2 lines

Add an optional move limit during game generation.

------------------------------------------------------------------------
r7553 | simon | 2007-05-07 21:51:37 +0400 (, 07  2007) | 3 lines

Slight solver speedup by tracking more carefully which block merges
we've already tried, and not trying them again.

------------------------------------------------------------------------
r7552 | simon | 2007-05-07 21:50:14 +0400 (, 07  2007) | 2 lines

Add a new misc.c function needed by Slide's colour setup.

------------------------------------------------------------------------
r7547 | simon | 2007-05-07 18:49:05 +0400 (, 07  2007) | 2 lines

Close-to-finished auto-generating implementation of Klotski.

------------------------------------------------------------------------
r7542 | simon | 2007-05-06 13:54:34 +0400 (, 06  2007) | 3 lines

I still haven't managed to get the WinCE port building via bob, but
I should at least check in what I've got.

------------------------------------------------------------------------
r7446 | simon | 2007-04-04 23:12:17 +0400 (, 04  2007) | 2 lines

Ensure the shuffling process never produces an already-solved grid.

------------------------------------------------------------------------
r7436 | jacob | 2007-03-31 20:00:50 +0400 (, 31  2007) | 2 lines

In the Windows frontend, stop tab navigation from activating buttons.

------------------------------------------------------------------------
r7409 | simon | 2007-03-26 14:24:25 +0400 (, 26  2007) | 2 lines

Er, and now do that _without_ introducing further segfaults.

------------------------------------------------------------------------
r7408 | simon | 2007-03-26 14:20:51 +0400 (, 26  2007) | 2 lines

Stop failing assertions when we encounter an insoluble puzzle.

------------------------------------------------------------------------
r7407 | simon | 2007-03-23 21:08:21 +0300 (, 23  2007) | 4 lines

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.

------------------------------------------------------------------------
r7400 | jacob | 2007-03-16 16:32:43 +0300 (, 16  2007) | 2 lines

Disallow clicks between squares.

------------------------------------------------------------------------
r7387 | simon | 2007-03-11 13:39:44 +0300 (, 11  2007) | 3 lines

r7364 failed to expand a malloc to match the larger data being put
in it.

------------------------------------------------------------------------
r7386 | simon | 2007-03-11 13:12:45 +0300 (, 11  2007) | 8 lines

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.

------------------------------------------------------------------------
r7385 | simon | 2007-03-11 13:04:00 +0300 (, 11  2007) | 4 lines

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.

------------------------------------------------------------------------
r7369 | jacob | 2007-03-04 02:43:22 +0300 (, 04  2007) | 3 lines

Since we've changed the semantics of the `expand' argument to midend_size(),
change the name. Also document the new semantics.

------------------------------------------------------------------------
r7368 | jacob | 2007-03-04 02:17:35 +0300 (, 04  2007) | 5 lines

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.)

------------------------------------------------------------------------
r7367 | jacob | 2007-03-04 01:39:17 +0300 (, 04  2007) | 5 lines

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.

------------------------------------------------------------------------
r7366 | jacob | 2007-03-04 01:05:05 +0300 (, 04  2007) | 3 lines

Refactoring patch from Ben Hutchings: move all the Gtk resize code into one
place. (From Debian bug#379452)

------------------------------------------------------------------------
r7364 | simon | 2007-03-03 20:36:44 +0300 (, 03  2007) | 2 lines

Patch from James H to provide resizability on Windows.

------------------------------------------------------------------------
r7363 | simon | 2007-03-03 20:25:13 +0300 (, 03  2007) | 2 lines

Minor cleanups (mostly \ns in diagnostic printfs) from James H.

------------------------------------------------------------------------
r7362 | simon | 2007-03-03 20:15:25 +0300 (, 03  2007) | 9 lines

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.

------------------------------------------------------------------------
r7356 | simon | 2007-03-03 12:41:51 +0300 (, 03  2007) | 3 lines

About time I got round to documenting the new
REQUIRE_{RBUTTON,NUMPAD} flags.

------------------------------------------------------------------------
r7355 | jacob | 2007-03-02 23:14:15 +0300 (, 02  2007) | 2 lines

Fix problems with arrow UI with non-square grid.

------------------------------------------------------------------------
r7354 | simon | 2007-03-01 21:57:36 +0300 (, 01  2007) | 14 lines

Silliness! Here's a somewhat hacky patch which builds an additional
binary from the Galaxies source file. The function of the new
`galaxiespicture' is to take a .xbm bitmap on standard input and
convert it into a Galaxies game ID using both black and white dots,
such that when solved the puzzle displays the input bitmap.

In the process of this I've implemented a post-processing pass after
the main game generation, to prevent clusters of adjacent
singletons. James H already solved that problem for unconstrained
game generation, but for some reason it came back when I did this.
However, the post-processing pass is still turned off for normal
usage, on the basis that (a) if it ain't broke don't fix it, and (b)
it's rather slow and best avoided if not necessary.

------------------------------------------------------------------------
r7352 | simon | 2007-03-01 16:29:53 +0300 (, 01  2007) | 4 lines

Amend README so that it makes reasonable sense no matter whether
you've got your source code from a tarball (with makefiles) or from
svn (without makefiles). While I'm here, mention Makefile.wce.

------------------------------------------------------------------------
r7351 | simon | 2007-03-01 10:41:11 +0300 (, 01  2007) | 3 lines

Cleanup patch from James H: disable the `s' key, which was only in
there by accident.

------------------------------------------------------------------------
r7350 | simon | 2007-03-01 10:39:05 +0300 (, 01  2007) | 3 lines

Adam D. Lopresto and Phil Bordelon independently point out a
signedness mismatch.

------------------------------------------------------------------------
r7349 | simon | 2007-03-01 10:32:35 +0300 (, 01  2007) | 3 lines

Bound edge thicknesses below so that they're always thicker than the
grid lines.

------------------------------------------------------------------------
r7347 | jacob | 2007-03-01 01:22:30 +0300 (, 01  2007) | 2 lines

Fix some border drawing issues.

------------------------------------------------------------------------
r7346 | jacob | 2007-03-01 00:49:48 +0300 (, 01  2007) | 3 lines

MinGW windres doesn't like an empty resource file, so invent a resource to
keep it happy. (Hopefully this hack will be temporary.)

------------------------------------------------------------------------
r7344 | simon | 2007-03-01 00:19:15 +0300 (, 01  2007) | 9 lines

General cleanups patch from James H:
 - missing static in filling.c
 - better robustness in execute_move() in filling.c
 - remove side effects in assert statements
 - remove rogue diagnostic in galaxies.c
 - remove // comment in map.c
 - add more stylus-friendly UI to Pattern
 - bias Unequal towards generating inequality clues rather than numeric

------------------------------------------------------------------------
r7343 | simon | 2007-03-01 00:02:31 +0300 (, 01  2007) | 3 lines

Gary Wong points out a couple of minor errors in the setting of
`used_solve'.

------------------------------------------------------------------------
r7341 | simon | 2007-02-28 00:03:06 +0300 (, 28  2007) | 4 lines

Provide my old drag-based interface to Net as an ifdef-enabled
option, and turn it on by default on stylus-based platforms (i.e.
currently PocketPC).

------------------------------------------------------------------------
r7340 | simon | 2007-02-27 23:52:03 +0300 (, 27  2007) | 2 lines

Another thing to watch out for when adding new puzzles.

------------------------------------------------------------------------
r7339 | simon | 2007-02-27 23:49:40 +0300 (, 27  2007) | 6 lines

Create a blank .rc file to be used in the absence of icons/foo.rc.
This means that puzzles.rc2 is always included in all Windows and
PocketPC builds, which in turn means that I should be able to start
filling it full of VERSIONINFO and have that reliably included as
well.

------------------------------------------------------------------------
r7338 | simon | 2007-02-27 23:46:15 +0300 (, 27  2007) | 2 lines

This game requires the numpad.

------------------------------------------------------------------------
r7337 | simon | 2007-02-26 23:35:47 +0300 (, 26  2007) | 9 lines

Dariusz Olszewski's changes to support compiling for PocketPC. This
is mostly done with ifdefs in windows.c; so mkfiles.pl generates a
new makefile (Makefile.wce) and Recipe enables it, but it's hardly
any different from Makefile.vc apart from a few definitions at the
top of the files.

Currently the PocketPC build is not enabled in the build script, but
with any luck I'll be able to do so reasonably soon.

------------------------------------------------------------------------
r7336 | simon | 2007-02-26 02:30:14 +0300 (, 26  2007) | 4 lines

After it confused Verity, clarify in the Unequal docs that the
Trivial and Recursive difficulty levels are available for custom
selection even though no preset uses them.

------------------------------------------------------------------------
r7335 | simon | 2007-02-25 18:57:35 +0300 (, 25  2007) | 4 lines

Hardwiring the grid line width to 1 is really bad for printing. Use
a slightly more conventional method of drawing the grid lines, and
thereby fix printing.

------------------------------------------------------------------------
r7334 | simon | 2007-02-25 18:50:24 +0300 (, 25  2007) | 2 lines

Galaxies doesn't print in colour.

------------------------------------------------------------------------
r7333 | simon | 2007-02-25 16:00:58 +0300 (, 25  2007) | 2 lines

Don't create an undo-chain entry for a move with no effect.

------------------------------------------------------------------------
r7331 | jacob | 2007-02-25 15:54:46 +0300 (, 25  2007) | 3 lines

Fix a UI glitch where dragging an existing arrow could change what it
referred to.

------------------------------------------------------------------------
r7330 | simon | 2007-02-25 15:18:20 +0300 (, 25  2007) | 2 lines

Tweak the cropping of the Filling icon very slightly.

------------------------------------------------------------------------
r7329 | simon | 2007-02-25 15:12:35 +0300 (, 25  2007) | 3 lines

Update the checklist (yet again) to try to prevent a recurrence of
the error I corrected in r7328.

------------------------------------------------------------------------
r7328 | simon | 2007-02-25 15:11:47 +0300 (, 25  2007) | 2 lines

Forgot to enable the Windows icon.

------------------------------------------------------------------------
r7327 | simon | 2007-02-25 15:04:42 +0300 (, 25  2007) | 2 lines

More updates to the new-puzzle checklist.

------------------------------------------------------------------------
r7326 | simon | 2007-02-25 14:37:05 +0300 (, 25  2007) | 2 lines

New puzzle: `Filling', a Fillomino implementation by Jonas Koelker.

------------------------------------------------------------------------
r7325 | simon | 2007-02-25 14:03:29 +0300 (, 25  2007) | 2 lines

More ignores.

------------------------------------------------------------------------
r7324 | simon | 2007-02-25 13:10:51 +0300 (, 25  2007) | 3 lines

Oops. Having built the installer, we need a redirect for it in
.htaccess.

------------------------------------------------------------------------
r7319 | simon | 2007-02-24 22:33:38 +0300 (, 24  2007) | 2 lines

Build an installer for Puzzles.

------------------------------------------------------------------------
r7318 | simon | 2007-02-24 20:34:21 +0300 (, 24  2007) | 3 lines

Somehow I let a couple of // comments get past me when I accepted
this file. Remove them.

------------------------------------------------------------------------
r7315 | simon | 2007-02-23 13:42:01 +0300 (, 23  2007) | 2 lines

Update ignore property. (Again.)

------------------------------------------------------------------------
r7314 | simon | 2007-02-23 02:18:51 +0300 (, 23  2007) | 3 lines

Phil Bordelon points out that when I renamed `Recursive' I missed a
bit.

------------------------------------------------------------------------
r7313 | jacob | 2007-02-23 00:31:59 +0300 (, 23  2007) | 4 lines

Remove spurious semicolons from macros; their upset compilers that don't like
mixing declarations and code (I accidentally tried to compile it with one
such).

------------------------------------------------------------------------
r7312 | simon | 2007-02-22 22:05:10 +0300 (, 22  2007) | 3 lines

And fix the error _I_ made in r7311. I should stop coding now,
because I'm clearly too sleepy to get it right.

------------------------------------------------------------------------
r7311 | simon | 2007-02-22 21:59:15 +0300 (, 22  2007) | 4 lines

Part of r7310 completely changed the careful semantics of my
coordinate-rounding, causing picking up arrows from a dot anywhere
other than at the centre of a square to break.

------------------------------------------------------------------------
r7310 | simon | 2007-02-22 21:13:12 +0300 (, 22  2007) | 4 lines

Patch from James H to make the Palm compiler stop objecting to my
(as far as I could tell) perfectly legal use of floats, and also
remove some VC warnings.

------------------------------------------------------------------------
r7309 | simon | 2007-02-22 21:09:51 +0300 (, 22  2007) | 12 lines

We may reluctantly permit the returning of a too-easy puzzle if an
adequately hard one couldn't be found, but we must never return a
puzzle harder than the user asked for, and we _certainly_ mustn't
return one that we aren't even sure has a unique solution.

However, when I attempted to implement this rule, it turned out that
an attempt to generate a 15x15 Easy puzzle didn't terminate before I
got bored and killed it. I'm therefore retiring the Easy difficulty
level on the grounds that it's not a wide enough band to be useful.
I've renamed Hard to Normal, and (while I was there) renamed
Recursive to Unreasonable in line with my normal practice.

------------------------------------------------------------------------
r7308 | simon | 2007-02-22 13:06:59 +0300 (, 22  2007) | 2 lines

James H forgot to credit himself for Galaxies!

------------------------------------------------------------------------
r7307 | simon | 2007-02-22 12:54:52 +0300 (, 22  2007) | 2 lines

Update the new-puzzle checklist for the post-bob world.

------------------------------------------------------------------------
r7305 | simon | 2007-02-22 12:50:33 +0300 (, 22  2007) | 2 lines

Missing uses of \q{}.

------------------------------------------------------------------------
r7304 | simon | 2007-02-22 12:31:43 +0300 (, 22  2007) | 2 lines

Add James Harvey's excellent new puzzle, `Galaxies'.

------------------------------------------------------------------------
r7302 | simon | 2007-02-19 22:38:00 +0300 (, 19  2007) | 3 lines

Forgot to shuffle the num[] array! That was probably introducing
some really subtle probabilistic bias in the generated latin squares.

------------------------------------------------------------------------
r7286 | jacob | 2007-02-14 02:01:50 +0300 (, 14  2007) | 2 lines

Replicate r7285 from PuTTY: make keyboard input work in HTML Help.

------------------------------------------------------------------------
r7224 | simon | 2007-02-05 15:41:21 +0300 (, 05  2007) | 2 lines

Now we have the new `module' command, use it.

------------------------------------------------------------------------
r7217 | simon | 2007-02-04 17:35:23 +0300 (, 04  2007) | 2 lines

Reinstate the icons in the Windows binaries.

------------------------------------------------------------------------
r7215 | simon | 2007-02-04 17:03:52 +0300 (, 04  2007) | 2 lines

Forgot to tag the Mac and Windows binaries with the revision number.

------------------------------------------------------------------------
r7214 | simon | 2007-02-04 16:44:38 +0300 (, 04  2007) | 3 lines

Looking for puzzles*.tar.gz in the right directory is liable to make
the .htaccess build work better :-)

------------------------------------------------------------------------
r7206 | simon | 2007-02-04 14:44:10 +0300 (, 04  2007) | 6 lines

Build script for Puzzles using bob. I've also added a piece of extra
infrastructure to the mkfiles.pl framework for the convenience of
the build script: it generates `wingames.lst', a list of the Windows
binaries which are ship-worthy games as opposed to nullgame or
command-line auxiliary programs.

------------------------------------------------------------------------
r7172 | simon | 2007-01-27 13:25:20 +0300 (, 27  2007) | 2 lines

Misdirected cross-reference spotted by Jonas Koelker.

------------------------------------------------------------------------
r7116 | simon | 2007-01-16 15:54:24 +0300 (, 16  2007) | 4 lines

Marcin Wojdyr points out that the use of `>&' to redirect both
stdout and stderr is non-standard. Switch to a POSIX-blessed
alternative.

------------------------------------------------------------------------
r7115 | simon | 2007-01-16 02:30:44 +0300 (, 16  2007) | 5 lines

Phil Bordelon points out an off-by-one error: since Solo doesn't use
zero as a valid puzzle symbol, it can support at most 35 symbols,
not 36. (This is largely academic since IME anything above about 25
is impractical to generate, but there we go.)

------------------------------------------------------------------------
r7114 | simon | 2007-01-15 23:21:57 +0300 (, 15  2007) | 3 lines

Patch from James H which shouldn't change the functionality of
Loopy, but makes it build more sensibly on the Palm.

------------------------------------------------------------------------
r7113 | simon | 2007-01-15 23:07:18 +0300 (, 15  2007) | 3 lines

Patch from James H to fix the occasional generation of puzzles
harder than requested.

------------------------------------------------------------------------
r7112 | simon | 2007-01-15 23:04:11 +0300 (, 15  2007) | 4 lines

Phil Bordelon points out that the Unequal difficulty settings
documentation is a bit odd, and also offers a signedness fix in
latin.c.

------------------------------------------------------------------------
r7106 | simon | 2007-01-14 13:13:29 +0300 (, 14  2007) | 4 lines

Give all the intermediate files distinct file names, so that a
multi-CPU machine can speed up the icon build using `make -j' and
not have it break.

------------------------------------------------------------------------
r7105 | jacob | 2007-01-13 22:19:21 +0300 (, 13  2007) | 2 lines

Formatting tweaks / index terms in Unequal docs.

------------------------------------------------------------------------
r7103 | simon | 2007-01-13 18:17:55 +0300 (, 13  2007) | 3 lines

First time I've added a new puzzle since the icons-and-screenshots
upheaval. Modify the checklist accordingly.

------------------------------------------------------------------------
r7101 | simon | 2007-01-13 17:59:15 +0300 (, 13  2007) | 2 lines

Icon for Unequal.

------------------------------------------------------------------------
r7100 | simon | 2007-01-13 17:44:50 +0300 (, 13  2007) | 3 lines

Add James H's new puzzle, `Unequal' (otherwise known as the
Guardian's `Futoshiki').

------------------------------------------------------------------------
r7099 | simon | 2007-01-13 15:03:42 +0300 (, 13  2007) | 3 lines

Remove a couple of rogue make targets for `osx.icns.o' and
`osx-info.plist.o' which had crept into most of the Makefiles.

------------------------------------------------------------------------
r7092 | simon | 2007-01-11 12:26:09 +0300 (, 11  2007) | 6 lines

Rather to my surprise given the amount of testing this code has had,
Kevin Lyles spotted a tree234 bug! copytree234() segfaulted when
asked to copy a tree containing no elements, due to failing to allow
for the case that t->root might be NULL. Fixed, and added a
regression test.

------------------------------------------------------------------------
r7058 | jacob | 2007-01-04 22:24:43 +0300 (, 04  2007) | 3 lines

In Windows/Gtk front-ends, consistently use the ellipsis convention for naming
menu items which bring up dialogs.

------------------------------------------------------------------------
r7052 | simon | 2007-01-03 12:51:42 +0300 (, 03  2007) | 3 lines

Phil Bordelon's patch yesterday should have initialised the GError
to NULL.

------------------------------------------------------------------------
r7050 | simon | 2007-01-02 22:45:19 +0300 (, 02  2007) | 3 lines

Phil Bordelon points out that my invocation of gdk_pixbuf_save()
isn't quite right.

------------------------------------------------------------------------
r7048 | jacob | 2007-01-02 00:19:14 +0300 (, 02  2007) | 2 lines

It's a new year.

------------------------------------------------------------------------
r7040 | jacob | 2006-12-30 03:50:29 +0300 (, 30  2006) | 2 lines

Document the new --game and --load options on Unix.

------------------------------------------------------------------------
r7039 | jacob | 2006-12-30 03:26:16 +0300 (, 30  2006) | 2 lines

Make errors in option parsing actually _do_ something in interactive mode.

------------------------------------------------------------------------
r7038 | jacob | 2006-12-30 01:43:47 +0300 (, 30  2006) | 3 lines

Bring .R files for nullgame and unfinished puzzles up to date with the rest of
the world (by adding icon support).

------------------------------------------------------------------------
r7036 | jacob | 2006-12-29 19:42:02 +0300 (, 29  2006) | 2 lines

Update manual copyright to 2006.

------------------------------------------------------------------------
r7033 | jacob | 2006-12-29 00:39:22 +0300 (, 29  2006) | 2 lines

Add NO_HTMLHELP and turn it on by default in Makefile.cyg.

------------------------------------------------------------------------
r7031 | simon | 2006-12-28 20:07:21 +0300 (, 28  2006) | 11 lines

Enhance icon.pl to be a fully general Windows icon builder: it now
supports monochrome icons, can deal with any size of image you're
mad enough to put in there, and will construct icons with whatever
combination of sizes and resolutions you feel like specifying. This
has involved a change in the command-line syntax, hence the
adjustment to Makefile.

(I don't imagine that the changes described here will be critical to
Puzzles any time soon, but I might reuse this script elsewhere and
then I won't want it to have arbitrary limitations.)

------------------------------------------------------------------------
r7026 | simon | 2006-12-27 19:49:39 +0300 (, 27  2006) | 2 lines

`make all' targets are usually useful.

------------------------------------------------------------------------
r7025 | simon | 2006-12-27 18:49:16 +0300 (, 27  2006) | 2 lines

Er, further makedist fixes. Helps if you test _before_ checkin.

------------------------------------------------------------------------
r7024 | simon | 2006-12-27 18:36:27 +0300 (, 27  2006) | 3 lines

And update makedist.sh to put all the new stuff into the source
tarball.

------------------------------------------------------------------------
r7023 | simon | 2006-12-27 18:33:43 +0300 (, 27  2006) | 2 lines

Fix the Cygwin RCFLAGS in the light of recent changes.

------------------------------------------------------------------------
r7022 | simon | 2006-12-27 18:21:55 +0300 (, 27  2006) | 6 lines

Aha, this seems to be a more sensible way of getting screenshots:
instead of having the puzzle binary export its window ID to a script
which then runs xwd, we can use the gdk-pixbuf library to have the
puzzle binary _itself_ read its own internal pixmap and save it
straight to a PNG. How handy. And faster, and less timing-sensitive.

------------------------------------------------------------------------
r7021 | simon | 2006-12-27 18:10:59 +0300 (, 27  2006) | 7 lines

Support for run-time icons in the GTK puzzles. This involved another
mkfiles.pl change (I don't seem to be planning ahead very well this
week), this time to provide a list of fallback options for an object
file. That way, I have a no-icon.c which quietly replaces
icons/foo-icon.c if the latter doesn't exist, and so again people
checking straight out from Subversion shouldn't have trouble.

------------------------------------------------------------------------
r7020 | simon | 2006-12-27 14:05:20 +0300 (, 27  2006) | 16 lines

Actually introduce the ability to build the Windows icons into the
Windows puzzle binaries. This checkin involves several distinct
changes:
 - mkfiles.pl now has an extra feature: if an object file is listed
   in Recipe with a trailing question mark, it will be considered
   optional, and silently dropped from the makefile if its primary
   source file isn't present at the time mkfiles.pl runs. This means
   people who check out the puzzles from Subversion and just run
   mkfiles.pl shouldn't get build failures; they just won't get the
   icons.
 - all the .R files now use this feature to include an optional
   Windows resource file.
 - the .rc resource source files are built by icons/Makefile.
 - windows.c finds the icon if present and uses it in place of the
   standard Windows application icon.

------------------------------------------------------------------------
r7019 | simon | 2006-12-27 13:26:13 +0300 (, 27  2006) | 7 lines

Improve the icon images by cropping selected pieces out of most of
the main screenshots. (A few, like Map, were perfect already.)

In the process I've vertically reflected the puzzle shown in the
Pattern save file, to bring a more interesting piece of it into the
top left corner :-)

------------------------------------------------------------------------
r7017 | simon | 2006-12-27 01:00:11 +0300 (, 27  2006) | 11 lines

Code to construct Windows icon files for the puzzles, by munging the
screenshots into appropriate sizes and colour depths. This is all
done with a nasty Perl script, because ImageMagick does not output
correct .ICO format. Not sure why; it isn't _that_ hard.

I intend at some point to link the resulting icons into the actual
Windows puzzle binaries, but before then I have to make them
prettier: most of them would benefit from being derived from a
smaller crop of the puzzle screenshot instead of trying to fit the
whole thing in.

------------------------------------------------------------------------
r7014 | simon | 2006-12-26 19:47:28 +0300 (, 26  2006) | 16 lines

New mechanism for automatic generation of the puzzle screenshots on
the web, which I hope will also end up being extended to generate
both Windows and X icons for each individual puzzle. The mechanism
is: for each puzzle there's a save file in the `icons' subdirectory
showing a game state which I think is a decent illustration of the
puzzle, and then there's a nasty set of scripts which runs each
puzzle binary, loads that save file, grabs a screenshot using xwd,
and munges it into shape.

In order to support this I've added two new options (--redo and
--windowid) to all the GTK puzzles, which I don't expect ever to be
used outside the icons makefile. I've also added two more options
(--load and --id) which force a GTK puzzle to treat its command-line
option as a save file or as a game ID respectively (the previous
behaviour was always to guess, and sometimes it guessed wrong).

------------------------------------------------------------------------
r7013 | simon | 2006-12-24 19:30:45 +0300 (, 24  2006) | 2 lines

Minor const fix.

------------------------------------------------------------------------
r7009 | simon | 2006-12-24 18:56:47 +0300 (, 24  2006) | 3 lines

HTML Help support for Puzzles, with the same kind of automatic
fallback behaviour as PuTTY's support.

------------------------------------------------------------------------
r7006 | simon | 2006-12-23 11:44:51 +0300 (, 23  2006) | 3 lines

Ability to build a .CHM for Puzzles. I haven't yet arranged for it
to be used by the Windows binaries; that's the next step.

------------------------------------------------------------------------
r7003 | simon | 2006-12-21 20:11:56 +0300 (, 21  2006) | 4 lines

Small printing fix from Gary Wong. Shows up when printing with
solutions: the rightmost and lowermost lines of the grid never get
solution lines drawn on them.

------------------------------------------------------------------------
r6919 | simon | 2006-11-24 21:24:01 +0300 (, 24  2006) | 4 lines

Fix a couple of rounding errors in Inertia's gem-drawing code which
didn't happen to show up at the default resolution but made the gem
slightly skewed at larger sizes.

------------------------------------------------------------------------
r6916 | simon | 2006-11-23 16:17:31 +0300 (, 23  2006) | 7 lines

Optionally label the colours in Guess with letters of the alphabet.
Labels are toggled on and off by pressing L (just like Map). Might
help colour-blind users, and might also make it easier to describe
game positions to other people because `abbc' has fewer syllables
than `red, yellow, yellow, green', and hugely fewer letters if
you're typing it.

------------------------------------------------------------------------
r6914 | simon | 2006-11-20 13:20:46 +0300 (, 20  2006) | 10 lines

Patch I've had lurking around for over a year and not remembered to
commit: arrange that midend_set_timer(), hence game_timing_state(),
is called when the game_ui is changed. This allows timed games to
work by obscuring the initial layout until an initial click causes
it to be revealed, without requiring that they store that reveal
operation as a move in the undo chain. Not that any games actually
do this, but it's clearly a sensible thing to want to do: since
game_timing_state() _receives_ a game_ui as a parameter, obviously
it should be consulted when the game_ui changes.

------------------------------------------------------------------------
r6889 | simon | 2006-11-01 16:25:25 +0300 (, 01  2006) | 4 lines

James H's Palm-compatibility updates to the latest Loopy changes,
working around bugs in the Palm compiler and removing Palm-
incompatible diagnostics such as fprintf.

------------------------------------------------------------------------
r6888 | simon | 2006-11-01 14:31:20 +0300 (, 01  2006) | 6 lines

Mike's changes to dsf.c alter the internal storage format of dsf
structures, meaning that ad-hoc initialisation now doesn't work.
Hence, this checkin converts all ad-hoc dsf initialisations into
calls to dsf_init() or snew_dsf(). At least, I _hope_ I've caught
all of them.

------------------------------------------------------------------------
r6884 | jacob | 2006-10-29 20:40:45 +0300 (, 29  2006) | 3 lines

Minimal (i.e., lame) update to Loopy documentation to match reality -- it's
been wrong since r6299.

------------------------------------------------------------------------
r6883 | simon | 2006-10-29 12:41:02 +0300 (, 29  2006) | 10 lines

I'm sick and tired of having unfinished puzzle code lying around on
several different systems in strange directories. So I'm creating an
`unfinished' directory within source control, and centralising all
my half-finished, half-baked or otherwise half-arsed puzzle
implementations into it. Herewith Sokoban (playable but rubbish
generation), Pearl (Masyu - rubbish generation and nothing else),
Path (Number Link - rubbish generation and nothing else) and NumGame
(the Countdown numbers game - currently just a solver and not even a
generator yet).

------------------------------------------------------------------------
r6882 | simon | 2006-10-29 12:34:09 +0300 (, 29  2006) | 4 lines

r6880 accidentally backed out r6780. That's what I get for accepting
source files from Mike rather than patches, and not adequately
checking the result...

------------------------------------------------------------------------
r6881 | simon | 2006-10-29 12:17:07 +0300 (, 29  2006) | 2 lines

Add HTML documentation to the ignore list.

------------------------------------------------------------------------
r6880 | simon | 2006-10-28 19:38:53 +0400 (, 28  2006) | 3 lines

Mike Pinna has done some major reworking of the Loopy solver, giving
rise to a new Hard difficulty level.

------------------------------------------------------------------------
r6872 | simon | 2006-10-17 12:25:40 +0400 (, 17  2006) | 2 lines

Couple of minor errors.

------------------------------------------------------------------------
r6849 | simon | 2006-09-06 12:23:15 +0400 (, 06  2006) | 2 lines

Forgot to put the new .R files into makedist.sh. Oops!

------------------------------------------------------------------------
r6796 | simon | 2006-08-25 11:10:59 +0400 (, 25  2006) | 5 lines

Jesse W points out that I forgot to update the OS X front end in
r6420, so both drawing.c _and_ the front end were prepending the
time to the front of the Mines status bar, leading to a double
timestamp.

------------------------------------------------------------------------
r6782 | simon | 2006-08-05 21:25:09 +0400 (, 05  2006) | 4 lines

Always something. Mention `svn add'ing the .R file in the new-puzzle
checklist, and mention the now-not-version-controlled list.c in
svn:ignore.

------------------------------------------------------------------------
r6781 | simon | 2006-08-05 21:20:29 +0400 (, 05  2006) | 19 lines

I'm sick of repeatedly adding and removing local changes to Recipe
when testing a new game, so here's a new architecture for the Recipe
file. mkfiles.pl now supports several new features:

 - an `!include' directive, which accepts wildcards
 - += to append to an existing object group definition
 - the ability to divert output to an arbitrary file.

So now each puzzle has a `.R' file containing a fragment of Recipe
code describing that puzzle, and the central Recipe does `!include
*.R' to construct the Makefiles. That way, I can keep as many
experimental half-finished puzzles lying around my working directory
as I like, and I won't have to keep reverting Recipe when I check in
any other changes.

As part of this change, list.c is no longer a version-controlled
file; it's now constructed by mkfiles.pl, so that it too can take
advantage of this mechanism.

------------------------------------------------------------------------
r6780 | simon | 2006-08-05 20:35:25 +0400 (, 05  2006) | 2 lines

Extra utility function.

------------------------------------------------------------------------
r6749 | simon | 2006-07-07 17:59:16 +0400 (, 07  2006) | 2 lines

Random docs cleanups I've collected together.

------------------------------------------------------------------------
r6745 | jacob | 2006-06-27 02:01:51 +0400 (, 27  2006) | 6 lines

Since r6711, puzzles built with Gtk 1.2 would take double actions when a menu
accelerator key (N/U/R/Q) was pressed -- once for the menu accelerator, and
once more in key_event().
This workaround, while unlovely, should at least not break in future (since the
things it relies on are unlikely to change).

------------------------------------------------------------------------
r6712 | simon | 2006-05-20 16:06:41 +0400 (, 20  2006) | 4 lines

Trivial patch from Ben Hutchings to support resizable windows under
GTK. All the infrastructure in the midend and beyond was already
there; it was just a matter of enabling it!

------------------------------------------------------------------------
r6711 | simon | 2006-05-20 16:01:55 +0400 (, 20  2006) | 3 lines

Ben Hutchings's patch to add display of key accelerators in the Game
menu.

------------------------------------------------------------------------
r6710 | simon | 2006-05-20 15:58:24 +0400 (, 20  2006) | 4 lines

Patch from Ben Hutchings to prevent an ugly special case in
&splitline in which a line is `split' into a line ending in a
backslash followed by a completely blank line.

------------------------------------------------------------------------
r6709 | simon | 2006-05-20 15:54:21 +0400 (, 20  2006) | 5 lines

Cleanup patch from Ben Hutchings, fixing some odd-looking range
checks. He thinks they were harmless (due to being followed by other
range checks in RIGHTOF_DOT and friends) but it clearly can't hurt
to fix them anyway.

------------------------------------------------------------------------
r6708 | simon | 2006-05-20 15:52:22 +0400 (, 20  2006) | 3 lines

Patch from Ben Hutchings to prevent memory leakage during Loopy game
generation.

------------------------------------------------------------------------
r6601 | simon | 2006-03-12 12:06:27 +0300 (, 12  2006) | 2 lines

Tidy up comments.

------------------------------------------------------------------------
r6591 | simon | 2006-03-06 23:03:27 +0300 (, 06  2006) | 14 lines

Introduce a new deductive mode in Slant's Hard level, which is the
generalisation of the previous deduction involving two 3s or two 1s
either adjacent or separated by a row of contiguous 2s. I always
said that was an ugly loop and really ought to arise naturally as a
special case of something more believable, and here it is.

The practical upshot is that Hard mode has just become slightly
harder: some grids generated by the new Slant will be unsolvable by
the old one's solver. I don't think it's become _excessively_ more
hard; I think I'm happy with the new difficulty level. (In
particular, I don't think the new level is sufficiently harder than
the old to make it worth preserving the old one as Medium or
anything like that.)

------------------------------------------------------------------------
r6590 | jacob | 2006-03-03 23:04:13 +0300 (, 03  2006) | 5 lines

"Hold" function in Guess was completely broken.
Fix it, add holds to the undo history (by analogy with Net), and save the
current holds in saved games.
Also fix a couple of unrelated minor issues with string encoding.

------------------------------------------------------------------------
r6589 | simon | 2006-03-02 22:39:46 +0300 (, 02  2006) | 7 lines

I've been pondering whether to do this for months: turn the rather
washed-out yellow and green in Guess into their full-brightness pure
forms. This makes them hard to see against some backgrounds, so I'm
also surrounding all coloured pegs with black outlines. Looks a
little cartoony, but I think it's an overall improvement on the
previous look.

------------------------------------------------------------------------
r6580 | simon | 2006-02-20 22:51:50 +0300 (, 20  2006) | 10 lines

Mines's error signalling is highly asymmetric: if you erroneously
believe a square to be empty, you find out instantly and lethally,
but if you erroneously believe a square to be full you can
occasionally (when it doesn't cause a complementary square to be
assumed empty) not notice until you find at the very end of the game
that you're one mine heavy. To help with this, here's an error
highlighting patch: any number square surrounded by an excess of
flags will now light up red. This should be an unintrusive change,
because it will never happen unless you make a mistake.

------------------------------------------------------------------------
r6575 | simon | 2006-02-19 15:54:17 +0300 (, 19  2006) | 2 lines

Small docs patch from Phil Bordelon adding more history of Sudoku.

------------------------------------------------------------------------
r6573 | simon | 2006-02-19 15:42:46 +0300 (, 19  2006) | 3 lines

Patch from Phil Bordelon to improve Bridges' appearance by adjusting
the font size.

------------------------------------------------------------------------
r6542 | simon | 2006-02-08 00:45:50 +0300 (, 08  2006) | 6 lines

Tal Kelrich spotted that hitting `Solve' on a configuration which is
laser-indistinguishable from the right solution _but_ has a number
of balls outside the acceptable range does not report an error. His
example was the game ID w8h8m5M5:1e3e6e80fa3e16265ccef7ca , omitting
the rightmost ball in the second row.

------------------------------------------------------------------------
r6513 | jacob | 2006-01-08 21:18:11 +0300 (, 08  2006) | 2 lines

It's a new year.

------------------------------------------------------------------------
r6511 | simon | 2006-01-05 12:40:51 +0300 (, 05  2006) | 3 lines

Revert a change in an assertion made in r6299. It was right the
first time, and now has a comment explaining why!

------------------------------------------------------------------------
r6509 | jacob | 2005-12-27 18:36:21 +0300 (, 27  2005) | 2 lines

Add some random index terms. ("Sudoku" wasn't in the index!)

------------------------------------------------------------------------
r6508 | simon | 2005-12-27 02:24:09 +0300 (, 27  2005) | 15 lines

Laurent Thioudellet reports that gcc4's ultra-cautious data flow
warnings require two more variables to be explicitly initialised. In
fact these variables are reliably initialised by a subfunction; gcc3
was happy to assume I knew what I was doing when it couldn't prove
they were definitely used uninitialised, whereas gcc4 apparently
takes the view that the onus is on me to allow it to prove they
_aren't_. I regard this as a step backwards, since the effect will
be to make explicit initialisation commonplace in cases where the
initialiser value is chosen arbitrarily and never expected to be
used, at which point (a) it will be less clear which initialisers
have genuine purpose and which are compiler-placating fluff, and (b)
valgrind's run-time uninitialised-data tracking will become less
useful. Still, the effect doesn't seem great as yet, so here's the
gcc4-placating checkin.

------------------------------------------------------------------------
r6507 | simon | 2005-12-26 14:26:34 +0300 (, 26  2005) | 4 lines

I've just noticed a bug in the Inertia solver: if you call it on an
already-solved grid (i.e. no gems), it will still attempt to show
you a move you can make. Eliminate that special case.

------------------------------------------------------------------------
r6452 | simon | 2005-11-10 14:57:15 +0300 (, 10  2005) | 2 lines

Correct w/h mixup in grid edge checks.

------------------------------------------------------------------------
r6423 | jacob | 2005-10-22 23:58:59 +0400 (, 22  2005) | 2 lines

Document Unix command-line options.

------------------------------------------------------------------------
r6422 | jacob | 2005-10-22 22:18:21 +0400 (, 22  2005) | 2 lines

Fix segfault in Tents' printing.

------------------------------------------------------------------------
r6421 | jacob | 2005-10-22 22:07:56 +0400 (, 22  2005) | 11 lines

Work around a couple of minor display issues with max bridges set to 4:

 - the highlighting for a set of 4 lines spilled outside the tile, so would
   leave white residue if undone;

 - the endpoints of sets of 4 lines were not completely overprinted by the
   circle of an island (at least on Windows), which was untidy.

Fixed by reducing the gap width for groups of lines which wouldn't otherwise
fit in a tile (only).

------------------------------------------------------------------------
r6420 | simon | 2005-10-22 21:23:55 +0400 (, 22  2005) | 10 lines

Cleanup: relieve frontends of the duty to call
midend_rewrite_statusbar() and check the result against the last
string returned. This is now done centrally in drawing.c, and the
front end status bar function need only do what it says on the tin.

While I'm modifying the prototype of drawing_init(), I've also
renamed it drawing_new() for the same reason as random_new() (it
_allocates_ a drawing object, rather than just initialising one
passed in).

------------------------------------------------------------------------
r6419 | simon | 2005-10-22 21:00:35 +0400 (, 22  2005) | 12 lines

Cleanup: remove the `just_used_solve' field from a number of games
which didn't actually need it. It was originally introduced in
Fifteen to suppress animation on Solve moves, but midend.c now does
that centrally unless the game specifically instructs it otherwise.
Therefore, just_used_solve is obsolete in all games which previously
used it. (Mines was even worse: it scrupulously maintained the
correctness of the field but never used it!)

Untangle is exempt from this cleanup: its `just_solved' field is
used to change the _length_ of the animation on Solve moves, not to
suppress it entirely, and so it has to stay.

------------------------------------------------------------------------
r6418 | simon | 2005-10-22 20:53:06 +0400 (, 22  2005) | 2 lines

Forgot to update devel.but in r6417.

------------------------------------------------------------------------
r6417 | simon | 2005-10-22 20:52:16 +0400 (, 22  2005) | 6 lines

Cleanup: it was absolutely stupid for game_wants_statusbar() to be a
function, since it took no parameters by which to vary its decision,
and in any case it's hard to imagine a game which only
_conditionally_ wants a status bar. Changed it into a boolean data
field in the backend structure.

------------------------------------------------------------------------
r6416 | simon | 2005-10-22 20:44:38 +0400 (, 22  2005) | 9 lines

Cleanup: remove the game_state parameter to game_colours(). No game
was actually using it, and also it wasn't being called again for
different game states or different game parameters, so it would have
been a mistake to depend on anything in that game state. Games are
now expected to commit in advance to a single fixed list of all the
colours they will ever need, which was the case in practice already
and simplifies any later port to a colour-poor platform. Also this
change has removed a lot of unnecessary faff from midend_colours().

------------------------------------------------------------------------
r6415 | simon | 2005-10-22 20:38:15 +0400 (, 22  2005) | 7 lines

Noticed recently that bitcount16() isn't 16-bit clean due to signed
shift right. It doesn't actually matter in the current code since
the input word only ever uses the bottom 9 bits, but if I ever
extended Mines to work in a triangular grid then all 16 bits might
be required. Fix this now, while I'm cleaning things up, so that it
won't bite me unexpectedly in future.

------------------------------------------------------------------------
r6414 | simon | 2005-10-22 20:35:23 +0400 (, 22  2005) | 4 lines

Cleanup: the `mouse_priorities' field in the back end has been a
more general-purpose flags word for some time now. Rename it to
`flags'.

------------------------------------------------------------------------
r6413 | simon | 2005-10-22 20:34:28 +0400 (, 22  2005) | 3 lines

OS X frontend was directly calling the backend's wants_statusbar()
function, whereas it ought to have been calling the midend's one.

------------------------------------------------------------------------
r6412 | simon | 2005-10-22 20:27:54 +0400 (, 22  2005) | 4 lines

Cleanup: rename random_init() to random_new(), because it actually
_allocates_ a random_state rather than just initialising one passed
in by the caller.

------------------------------------------------------------------------
r6409 | simon | 2005-10-21 12:07:31 +0400 (, 21  2005) | 2 lines

New puzzle from James H: `Bridges', another Nikoli job.

------------------------------------------------------------------------
r6405 | simon | 2005-10-17 22:41:05 +0400 (, 17  2005) | 7 lines

Miscellaneous fixes. Correct a comparison of y with w causing
assertion failures in portrait-type grids; retire an unused array in
the game generation function (my original generation strategy needed
it, but the final one didn't); correct a typo; further restrict the
generable sizes of game and include a special case for 4x4dt to
prevent a tight loop.

------------------------------------------------------------------------
r6404 | simon | 2005-10-17 22:32:24 +0400 (, 17  2005) | 3 lines

Just noticed a longhand shuffling operation which I must have missed
when I converted them all into calls to shuffle().

------------------------------------------------------------------------
r6403 | simon | 2005-10-15 20:03:14 +0400 (, 15  2005) | 2 lines

Janes H provides a small workaround for a Palm tools bug.

------------------------------------------------------------------------
r6402 | simon | 2005-10-15 19:01:40 +0400 (, 15  2005) | 2 lines

Small error in solver diagnostics.

------------------------------------------------------------------------
r6400 | simon | 2005-10-14 16:23:41 +0400 (, 14  2005) | 4 lines

Revamp of the control mechanism to permit drag- as well as
click-based control. Only used for right-dragging to clear a large
area to NONTENT.

------------------------------------------------------------------------
r6390 | simon | 2005-10-13 22:30:24 +0400 (, 13  2005) | 4 lines

New puzzle: `Tents'. Requires a potentially shared algorithms module
maxflow.c. Also in this checkin, fixes to the OS X and GTK back ends
to get ALIGN_VNORMAL right. This is the first time I've used it! :-)

------------------------------------------------------------------------
r6389 | simon | 2005-10-13 22:27:57 +0400 (, 13  2005) | 2 lines

loopy_diffnames[] isn't used, and provokes a warning on OS X.

------------------------------------------------------------------------
r6388 | simon | 2005-10-12 21:57:40 +0400 (, 12  2005) | 6 lines

Yikes! I've only just noticed that this copy of tree234.c was still
using unwrappered malloc/free, leaving plenty of openings for out-
of-memory segfaults. Switch to using Puzzles's memory management,
which I should have done right at the start but can only assume I
forgot about.

------------------------------------------------------------------------
r6385 | simon | 2005-10-10 21:22:33 +0400 (, 10  2005) | 10 lines

r6384 didn't go quite far enough. In fact, a grid square which
differs between oldstate and state in only the hint bit should not
have a flip animation even if hints_active is TRUE. Flip animations
should only happen for tiles which are changing their primary state.
(Put like that, it seems so obvious.)

Test case which demonstrates this fix to be right and r6384 to be
wrong: 3x3:101000000000000000000,300 . Hit Solve immediately and
then click on the red-highlighted squares.

------------------------------------------------------------------------
r6384 | simon | 2005-10-10 20:31:26 +0400 (, 10  2005) | 9 lines

Fixes for handling human-entered Flip games. The clicked-on square
always got a flip animation even when it wasn't one of the ones
being turned, and a square with no effect at all was still counting
as a move.

Since it's an invariant of Flip's internal generator that every
square includes itself as an effect, this never comes up in auto-
generated games.

------------------------------------------------------------------------
r6383 | simon | 2005-10-10 20:29:58 +0400 (, 10  2005) | 6 lines

Richard Earnshaw points out that if you enter an out-of-range number
in the game description, the solver will fail to notice it and
overrun an array leading to assertion failure, silent wrong answers
or (in extreme cases) segfaults. Hence, validate_desc() now spots
them and kicks them out.

------------------------------------------------------------------------
r6340 | simon | 2005-09-23 16:50:51 +0400 (, 23  2005) | 15 lines

Use game_set_size() to set up the temporary drawstate in
game_print(), wherever feasible. This fixes a specific bug in Loopy
(James H's new field ds->linewidth wasn't being set up, leading to
corrupted print output), but I've made the change in all affected
files because it also seems like a generally good idea to encourage
it for future games, to prevent other problems of this type.

There is one slight snag, which is that Map _can't_ do this because
its game_set_size() also initialises a blitter. I could fix this by
abstracting the common parts of Map's game_set_size() out into a
subfunction called by game_set_size() and also called directly by
game_print(); alternatively, I could introduce a means of
determining whether a `drawing *' was for screen or printing use.
Not sure which yet.

------------------------------------------------------------------------
r6339 | simon | 2005-09-23 16:43:42 +0400 (, 23  2005) | 2 lines

Fix very strange indentation issue!

------------------------------------------------------------------------
r6331 | simon | 2005-09-18 21:00:07 +0400 (, 18  2005) | 2 lines

Bug fix from James H: prevent LINEWIDTH ever reaching zero.

------------------------------------------------------------------------
r6322 | simon | 2005-09-18 16:09:16 +0400 (, 18  2005) | 5 lines

Another optimisation patch from Mike, which (among other things)
eliminates gratuitous duplication of the solver state every time it
goes round the main loop, in favour of the usual type of
`done_something' flag.

------------------------------------------------------------------------
r6312 | simon | 2005-09-15 22:09:27 +0400 (, 15  2005) | 3 lines

Optimisation patch from Mike: remember which squares we've entirely
finished dealing with, and don't do them again on the next loop.

------------------------------------------------------------------------
r6303 | simon | 2005-09-13 22:34:12 +0400 (, 13  2005) | 3 lines

Patch from Mike: fix an array indexing error in the clue
highlighting, and adjust the presets.

------------------------------------------------------------------------
r6299 | simon | 2005-09-12 21:13:26 +0400 (, 12  2005) | 9 lines

Patch from Mike:
 - remove the backtracking `Hard' level, on the grounds that it was
   incredibly slow and not really usable.
 - introduce an `Easy' difficulty level below the standard one; many
   people seem to find this puzzle unusually hard, so an easy level
   is particularly helpful.
 - highlight unfulfillable clue squares (but not yet any other types
   of obvious error).

------------------------------------------------------------------------
r6298 | simon | 2005-09-12 21:09:29 +0400 (, 12  2005) | 6 lines

I am again gormless! When I overhauled Solo's grid generator in
r6160, I completely failed to ensure that generated grids were _at
most_ the required difficulty. It appears to have been only random
chance that prevented a request for a Trivial puzzle from producing
Extreme. Here's a one-line fix.

------------------------------------------------------------------------
r6293 | simon | 2005-09-12 16:38:58 +0400 (, 12  2005) | 5 lines

I found a slightly odd-looking line of code in this file a few days
ago, and nearly changed it to the obvious thing. After some thought,
though, I've decided the `bug' is better off unfixed, and added a
comment explaining why.

------------------------------------------------------------------------
r6292 | simon | 2005-09-11 22:05:23 +0400 (, 11  2005) | 2 lines

Minor improvement to initial loop generation.

------------------------------------------------------------------------
r6291 | simon | 2005-09-11 18:53:39 +0400 (, 11  2005) | 2 lines

Oops; left some rogue diagnostics in.

------------------------------------------------------------------------
r6290 | simon | 2005-09-11 18:22:32 +0400 (, 11  2005) | 5 lines

Run the final solution-reduction pass in both directions, since
Gareth managed to find an example (10x8#458168771440033 in r6289)
where running it in only one direction failed to eliminate an
obviously redundant piece of path.

------------------------------------------------------------------------
r6289 | simon | 2005-09-11 16:40:49 +0400 (, 11  2005) | 3 lines

Solve function for Inertia, using what's essentially an approximate
TSP algorithm.

------------------------------------------------------------------------
r6288 | simon | 2005-09-11 15:57:24 +0400 (, 11  2005) | 3 lines

Marginally greater robustness in the face of solve_game() failing to
return an error message.

------------------------------------------------------------------------
r6283 | simon | 2005-09-10 13:39:29 +0400 (, 10  2005) | 13 lines

Completely rewrite the loop-detection algorithm used to check game
completion, _again_. In r6174 I changed it from dsf to conventional
graph theory so that it could actually highlight loops as opposed to
just discovering that one existed. Unfortunately, yesterday I
discovered a fundamental graph-theoretic error in the latter
algorithm: if you had two entirely separate loops connected by a
single path, the path would be highlighted as well as the loops.

Therefore, I've reverted to the original dsf technique, combined
with a subsequent pass to trace around each loop discovered. This
version seems to do a better job of only highlighting the actual
loops.

------------------------------------------------------------------------
r6282 | simon | 2005-09-10 12:31:22 +0400 (, 10  2005) | 3 lines

Patch from James H which initialises a couple of Windows API object
handles to NULL before accidentally trying to use them for anything.

------------------------------------------------------------------------
r6277 | simon | 2005-09-07 02:28:04 +0400 (, 07  2005) | 5 lines

I arranged that dying after the game was already completed didn't
increment the deaths counter. In doing so, I incorrectly handled the
borderline case, so that a death incurred _in the act_ of collecting
the final gem also didn't increment the deaths counter. Now it does.

------------------------------------------------------------------------
r6276 | simon | 2005-09-06 22:49:18 +0400 (, 06  2005) | 8 lines

Take the Windows taskbar into account when deciding on the maximum
size of the puzzle window. This has involved some _completely
stupid_ window manipulation: in order to figure out in advance how
big I want my main window to be, I first have to _create_ the status
bar so I know how tall it is; but since I can't reparent it into my
main window after I've created it, I then have to throw that status
bar away and create a new one. *sigh*

------------------------------------------------------------------------
r6275 | simon | 2005-09-05 21:21:05 +0400 (, 05  2005) | 4 lines

Various patches from Ben H: a fix for an outdated comment, a couple
of spurious ps_printf() arguments removed, and an error check in the
`make install' target.

------------------------------------------------------------------------
r6274 | simon | 2005-09-05 21:18:03 +0400 (, 05  2005) | 7 lines

I've dithered a bit in the past about whether or not it's allowable
to call game_set_size() twice on the same drawstate. Finally, a
definite decision: it isn't. Accordingly, midend.c arranges never to
do so, the devel docs state that puzzles may enforce by assertion
that it never happens, and the four puzzles which care (i.e. use
blitters) do so.

------------------------------------------------------------------------
r6271 | simon | 2005-09-04 16:53:27 +0400 (, 04  2005) | 3 lines

Patch from Ton van Overbeek to fix a small memory leak in
midend_solve().

------------------------------------------------------------------------
r6270 | simon | 2005-09-04 16:46:19 +0400 (, 04  2005) | 3 lines

Patch from Ton van Overbeek to correct Loopy's misplaced line ends
at small tile sizes.

------------------------------------------------------------------------
r6269 | simon | 2005-09-04 16:40:23 +0400 (, 04  2005) | 4 lines

Another global environment-variable override across all games. This
one is <game>_TILESIZE, adjusting the game's default size. I
anticipate that this will probably _mostly_ be useful for debugging.

------------------------------------------------------------------------
r6268 | simon | 2005-09-04 16:31:04 +0400 (, 04  2005) | 2 lines

Couple of minor updates to restore accuracy.

------------------------------------------------------------------------
r6265 | simon | 2005-09-03 22:32:58 +0400 (, 03  2005) | 6 lines

Patches from James H. The usual stuff (memory leak fixes and 16-bit
cleanliness), plus he's enlarged the pencil-mark circles from
TILESIZE/8 to TILESIZE/7. Makes no difference at all (thanks to
integer division) when TILESIZE is the default of 20, but presumably
helps at some other tile sizes. Fine by me.

------------------------------------------------------------------------
r6261 | simon | 2005-09-02 17:40:16 +0400 (, 02  2005) | 4 lines

Someone points out that the Solo text formatter would be a lot
better if it marked empty cells with something other than a space.
So here's a three-bit change to turn it into a dot :-)

------------------------------------------------------------------------
r6258 | simon | 2005-09-01 21:25:06 +0400 (, 01  2005) | 3 lines

Stop Light Up from eating system keypresses, which it was previously
doing whenever the cursor was active.

------------------------------------------------------------------------
r6257 | simon | 2005-09-01 16:17:14 +0400 (, 01  2005) | 2 lines

Optimiser placation.

------------------------------------------------------------------------
r6256 | simon | 2005-09-01 16:00:55 +0400 (, 01  2005) | 3 lines

Palm fixes for Loopy from James H: a #ifdef SLOW_SYSTEM, and an
int/long fix.

------------------------------------------------------------------------
r6255 | simon | 2005-09-01 15:59:51 +0400 (, 01  2005) | 2 lines

James H's memory leak fixes to Inertia.

------------------------------------------------------------------------
r6254 | simon | 2005-09-01 15:57:56 +0400 (, 01  2005) | 15 lines

James H has implemented a new `Tricky' difficulty level in Light Up:
a non-recursive level above Easy, which therefore moves the
recursive Hard mode further up still. Play-testing suggests that in
fact Tricky is often _harder_ than the old Hard mode, since the
latter had limited depth of recursion and would therefore spot
complex deductions only if it happened to start a recursion on the
right square; Tricky may be limited in the sophistication of its
complex deductions, but it never misses one, so its puzzles tend to
be hard all over.

Also in this checkin, a new source file `nullfe.c', containing all
the annoying stub functions required to make command-line solvers
link successfully. James wrote this for (the new) lightupsolver, and
I've used it to simplify the other stand-alone solvers.

------------------------------------------------------------------------
r6250 | simon | 2005-08-31 23:27:41 +0400 (, 31  2005) | 2 lines

Ability to drag pencil marks around.

------------------------------------------------------------------------
r6248 | simon | 2005-08-31 21:34:47 +0400 (, 31  2005) | 3 lines

Terribly cunning approach to making the pencil marks look nicer,
thanks to Gareth.

------------------------------------------------------------------------
r6247 | simon | 2005-08-31 20:59:51 +0400 (, 31  2005) | 2 lines

Debian requires -lm, where Red Hat didn't.

------------------------------------------------------------------------
r6245 | simon | 2005-08-31 16:43:14 +0400 (, 31  2005) | 3 lines

Ahem; forgot about recursion. Recursive solving now shows its
working as well.

------------------------------------------------------------------------
r6244 | simon | 2005-08-31 16:17:01 +0400 (, 31  2005) | 9 lines

Now that Map has some seriously complex deductions, it's about time
it had a command-line solver. In order to do this, I've had to
expose the internal region numbering because the solver has to have
some way to state which region it means; and in any case it's also
useful to have human-visible region numbering so that two people can
discuss a puzzle they're solving together. So pressing L during play
now toggles the display of region numbers; and `mapsolver' uses
those same numbers when showing its working and its solutions.

------------------------------------------------------------------------
r6240 | simon | 2005-08-30 23:42:45 +0400 (, 30  2005) | 4 lines

Forcing chains in Map give rise to a new `Hard' difficulty level.
Also implemented the Map analogue of Solo's pencil marks, to make
this mode more playable.

------------------------------------------------------------------------
r6239 | simon | 2005-08-30 21:44:18 +0400 (, 30  2005) | 11 lines

Implemented a couple more reasoning modes for Extreme difficulty
level: positional set elimination (which is so obvious I really
should have thought of it myself, though it's tricky to spot) and
forcing chains (which are a type of one-level proof by
contradiction, findable through a simple breadth-first search
without requiring recursion, but so ludicrously powerful that they
are able to solve _two thirds_ of grids that the pre-Extreme Solo
generated and rated as Unreasonable).

Of course this makes Unreasonable mode harder still...

------------------------------------------------------------------------
r6237 | simon | 2005-08-29 15:12:05 +0400 (, 29  2005) | 2 lines

Backspace and Delete keys now function like Space in Solo.

------------------------------------------------------------------------
r6236 | simon | 2005-08-29 13:14:35 +0400 (, 29  2005) | 2 lines

Typo in comment :-)

------------------------------------------------------------------------
r6235 | simon | 2005-08-29 13:05:35 +0400 (, 29  2005) | 3 lines

Ahem. The region density at which things start to get hairy is 2/3
of the grid area, not 3/2!

------------------------------------------------------------------------
r6234 | simon | 2005-08-29 12:57:45 +0400 (, 29  2005) | 6 lines

Aesthetic improvements to the Map error indicators:
 - the exclamation mark was a bit dot-heavy
 - allowing the indicator to be placed at a grid point as well as
   half way between two grid points allows some much more natural
   positioning.

------------------------------------------------------------------------
r6229 | simon | 2005-08-28 18:29:19 +0400 (, 28  2005) | 2 lines

Unreasonable mode for Map.

------------------------------------------------------------------------
r6228 | simon | 2005-08-28 17:53:07 +0400 (, 28  2005) | 2 lines

Error highlighting in Map.

------------------------------------------------------------------------
r6227 | simon | 2005-08-28 17:52:58 +0400 (, 28  2005) | 5 lines

There seems to be some odd behaviour when GTK is asked to draw an
outline polygon with a clipping rectangle active. I don't know or
care whether this is GTK or my X server or what, but I'm working
around it by drawing the lines myself, which seems to sort it out.

------------------------------------------------------------------------
r6226 | jacob | 2005-08-28 13:35:55 +0400 (, 28  2005) | 2 lines

HACKING.but -> devel.but

------------------------------------------------------------------------
r6225 | simon | 2005-08-27 13:53:38 +0400 (, 27  2005) | 2 lines

Fix array bounds violation in the solver. Oops.

------------------------------------------------------------------------
r6223 | simon | 2005-08-27 13:35:14 +0400 (, 27  2005) | 3 lines

OS X seems particularly picky about possibly uninitialised
variables. Placate its optimiser (again).

------------------------------------------------------------------------
r6222 | simon | 2005-08-27 13:21:22 +0400 (, 27  2005) | 4 lines

New puzzle: `Inertia', originally written for Windows by Ben
Olmstead and reimplemented with the help of his source code which he
was kind enough to release into the public domain.

------------------------------------------------------------------------
r6220 | jacob | 2005-08-26 23:44:25 +0400 (, 26  2005) | 2 lines

Trivial doc changes after recent prolificacy.

------------------------------------------------------------------------
r6219 | simon | 2005-08-25 22:14:54 +0400 (, 25  2005) | 2 lines

Memory leak and type safety fixes from James H.

------------------------------------------------------------------------
r6217 | simon | 2005-08-25 12:07:44 +0400 (, 25  2005) | 3 lines

Phil Bordelon points out that the general convention is to orient
rectangular presets in a portrait fashion.

------------------------------------------------------------------------
r6216 | simon | 2005-08-25 11:57:58 +0400 (, 25  2005) | 2 lines

Mike points out that I made an error in one of the presets...

------------------------------------------------------------------------
r6214 | simon | 2005-08-25 02:13:43 +0400 (, 25  2005) | 3 lines

Over-enthusiastic assertion introduced in the printing revamp was
causing Mines to crash one second after starting a game. Oops.

------------------------------------------------------------------------
r6212 | simon | 2005-08-25 01:44:54 +0400 (, 25  2005) | 2 lines

Optimiser placation for OS X gcc.

------------------------------------------------------------------------
r6211 | simon | 2005-08-25 01:32:54 +0400 (, 25  2005) | 3 lines

New puzzle: `Loopy', an implementation of Nikoli's `Slither Link' or
`Loop the Loop' puzzle. Contributed by Mike Pinna.

------------------------------------------------------------------------
r6210 | simon | 2005-08-24 21:49:52 +0400 (, 24  2005) | 2 lines

Minor update to Solo's documentation due to Extreme mode.

------------------------------------------------------------------------
r6209 | simon | 2005-08-24 21:32:39 +0400 (, 24  2005) | 13 lines

Brand new difficulty level in Solo. The other day Gareth and I
independently discovered an advanced reasoning technique in Map, and
then it occurred to me that since Solo can also be considered as a
graph-colouring game the same technique ought to be applicable. And
it is; so here's a new difficulty level, `Extreme', which sits just
above Advanced. Grids graded `Extreme' by new-Solo will of course
fall into old-Solo's `Unreasonable' category (since they're not
soluble using the old set of non-recursive methods). A brief and
unscientific experiment suggests that about one in six Unreasonable
grids generated by old-Solo are classified Extreme by the new
solver; so the remaining Unreasonable mode (now containing a subset
of the grids it used to) hasn't actually become much harder.

------------------------------------------------------------------------
r6203 | simon | 2005-08-23 16:49:21 +0400 (, 23  2005) | 3 lines

Don't report an error when loading a saved game from the command
line unless there really _is_ an error!

------------------------------------------------------------------------
r6202 | simon | 2005-08-23 02:58:19 +0400 (, 23  2005) | 2 lines

James H points out a rogue fprintf in Net's print routine.

------------------------------------------------------------------------
r6199 | simon | 2005-08-22 22:46:38 +0400 (, 22  2005) | 3 lines

Memory leak in the new printing stuff, plus a couple of comment
corrections.

------------------------------------------------------------------------
r6198 | simon | 2005-08-22 13:27:52 +0400 (, 22  2005) | 4 lines

`Solve' operation on an already solved map without an aux_info was
returning NULL due to no moves being required, leading to a strange
error message. Trivial fix.

------------------------------------------------------------------------
r6197 | simon | 2005-08-21 14:55:17 +0400 (, 21  2005) | 4 lines

*blinks* I apparently didn't try _building_ the OS X port since the
printing upheaval. I could have sworn I had. Oh well; small errors
fixed.

------------------------------------------------------------------------
r6194 | simon | 2005-08-20 19:49:43 +0400 (, 20  2005) | 3 lines

Retire redundant print_line_width() in Net: a relic from a failed
printing strategy, irrelevant to the one which worked.

------------------------------------------------------------------------
r6193 | simon | 2005-08-20 19:48:55 +0400 (, 20  2005) | 17 lines

Native Windows printing support, using the infrastructure I put in
place in r6190. I'm quite pleased that I didn't have to modify the
printing infrastructure _at all_ to make this work; the only source
change required outside windows.c was the addition of a trivial
utility function midend_get_params(), and that was for the benefit
of bulk puzzle generation rather than anything to do with actual
printing.

As far as I can tell, all printable puzzles now print almost
indistinguishably from the way they print under Unix. If you look
closely the font is slightly different, and the Windows standard
hatching doesn't seem to be quite as nice as the kind I did by hand
in ps.c (and, particularly annoyingly, hatched areas don't show up
at all for me when I print to a file and use gv, though they come
out fine on the printer itself); but it's all there, and it all
works.

------------------------------------------------------------------------
r6192 | simon | 2005-08-19 16:29:08 +0400 (, 19  2005) | 2 lines

Richard B points out a cut and paste error.

------------------------------------------------------------------------
r6191 | simon | 2005-08-19 11:49:44 +0400 (, 19  2005) | 3 lines

Bah, there's always one. Remove the now-erroneous `*.py' from the
makedist script.

------------------------------------------------------------------------
r6190 | simon | 2005-08-18 21:50:14 +0400 (, 18  2005) | 27 lines

Substantial infrastructure upheaval. I've separated the drawing API
as seen by the back ends from the one implemented by the front end,
and shoved a piece of middleware (drawing.c) in between to permit
interchange of multiple kinds of the latter. I've also added a
number of functions to the drawing API to permit printing as well as
on-screen drawing, and retired print.py in favour of integrated
printing done by means of that API.

The immediate visible change is that print.py is dead, and each
puzzle now does its own printing: where you would previously have
typed `print.py solo 2x3', you now type `solo --print 2x3' and it
should work in much the same way.

Advantages of the new mechanism available right now:
 - Map is now printable, because the new print function can make use
   of the output from the existing game ID decoder rather than me
   having to replicate all those fiddly algorithms in Python.
 - the new print functions can cope with non-initial game states,
   which means each puzzle supporting --print also supports
   --with-solutions.
 - there's also a --scale option permitting users to adjust the size
   of the printed puzzles.

Advantages which will be available at some point:
 - the new API should permit me to implement native printing
   mechanisms on Windows and OS X.

------------------------------------------------------------------------
r6189 | simon | 2005-08-15 18:12:07 +0400 (, 15  2005) | 3 lines

Just noticed another thing that could easily catch me out when
adding a new puzzle.

------------------------------------------------------------------------
r6188 | simon | 2005-08-14 01:35:41 +0400 (, 14  2005) | 2 lines

Memory leak fixes from James H.

------------------------------------------------------------------------
r6186 | simon | 2005-08-13 14:43:26 +0400 (, 13  2005) | 8 lines

New puzzle: `Map'. Vaguely original, for a change.

(This puzzle is theoretically printable, but I haven't added it in
print.py since there's rather a lot of painful processing required
to get from the game ID to the puzzle's visual appearance. It
probably won't become printable unless I get round to implementing a
more integrated printing architecture.)

------------------------------------------------------------------------
r6185 | simon | 2005-08-11 15:06:59 +0400 (, 11  2005) | 2 lines

Oops. Back out a local change I shouldn't have committed in r6184.

------------------------------------------------------------------------
r6184 | simon | 2005-08-11 15:06:13 +0400 (, 11  2005) | 7 lines

16-bit-cleanness fixes from James H (again). It would be really nice
to have some means of automatically spotting this sort of problem on
a desktop platform, but I can't immediately think of one; building a
trick compiler which thinks `int' is 16 bits would be the obvious
option, but it would immediately break the ABIs to all the system
functions.

------------------------------------------------------------------------
r6175 | simon | 2005-08-09 22:09:07 +0400 (, 09  2005) | 8 lines

Very fiddly corrections to the loop highlighting. ERRSLASH means the
slash in this square is red, so it does indeed imply that some of
the edge markings are also red; but it doesn't mean _all_ the edge
markings must be red. So instead of assuming ERRSLASH implies all
edge error markers, we set the correct set of edge error markers at
the same time as setting ERRSLASH, at which point we know which kind
of slash it is so we know which ones to set.

------------------------------------------------------------------------
r6174 | simon | 2005-08-09 21:14:25 +0400 (, 09  2005) | 12 lines

Implement error checking in Slant. Clue points are now highlighted
in red if it's impossible to fulfill them (either through too many
neighbours connecting to them, or too many not connecting to them),
and edges are highlighted in red if they form part of a loop.

In order to do this I've had to revamp the redraw function
considerably. Each square is now drawn including its top and left
grid edges, but _not_ its bottom or right ones - which means that I
need to draw an extra strip of empty squares outside the actual grid
in order to draw the few pixels which appear on the grid bottom and
right borders and also to red-highlight border clues.

------------------------------------------------------------------------
r6172 | simon | 2005-08-07 12:47:08 +0400 (, 07  2005) | 3 lines

Remove conditional definition of MAX_GRIDGEN_TRIES, for consistency
between Palm and other ports when fed the same random seed.

------------------------------------------------------------------------
r6171 | simon | 2005-08-07 12:01:51 +0400 (, 07  2005) | 2 lines

Placate optimiser.

------------------------------------------------------------------------
r6170 | simon | 2005-08-06 18:52:26 +0400 (, 06  2005) | 4 lines

Streamline `slantsolver' a bit (avoid showing advanced working on
easy puzzles, and stop having a second encoding of the difficulty
levels).

------------------------------------------------------------------------
r6169 | simon | 2005-08-06 14:38:34 +0400 (, 06  2005) | 3 lines

Document hard mode in Slant, and also fix an obvious memory
management error in game_configure().

------------------------------------------------------------------------
r6168 | simon | 2005-08-06 14:33:46 +0400 (, 06  2005) | 8 lines

Introduce an environment variable setting (SLANT_SWAP_BUTTONS=yes)
to reverse the effect of the mouse buttons. Gareth has been
complaining about this for days: apparently he finds precisely the
opposite control system intuitive to me.

This is a horrendous hack, and pushes me one step closer to losing
my temper and designing a proper preferences architecture.

------------------------------------------------------------------------
r6167 | simon | 2005-08-06 14:24:52 +0400 (, 06  2005) | 4 lines

A bunch of new reasoning techniques in the Slant solver, leading to
a new Hard mode. Also added a command-line `slantsolver' which can
grade puzzles and show working.

------------------------------------------------------------------------
r6166 | simon | 2005-08-05 21:17:23 +0400 (, 05  2005) | 6 lines

Cleanups to completion flashes: all four of these games used to
redraw the whole window _every_ time game_redraw() was called during
a flash. Now they only redraw the whole window every time the
background colour actually changes. Thanks to James H for much of
the work.

------------------------------------------------------------------------
r6164 | simon | 2005-08-04 23:14:10 +0400 (, 04  2005) | 8 lines

New puzzle: `Light Up', by James H.

Also in this checkin (committed by mistake - I meant to do it
separately), a behind-the-scenes change to Slant to colour the two
non-touching classes of diagonals in different colours. Both colours
are set to black by default, but configuration by way of
SLANT_COLOUR_* can distinguish them if you want.

------------------------------------------------------------------------
r6163 | simon | 2005-08-04 22:09:48 +0400 (, 04  2005) | 4 lines

Environment-based configuration wasn't sensibly usable in games with
spaces in the name. Fixed. (One day I really must get round to
turning this into a proper config mechanism.)

------------------------------------------------------------------------
r6162 | simon | 2005-08-04 21:08:26 +0400 (, 04  2005) | 2 lines

Patch from James H: tinker with the presets on SLOW_SYSTEMs.

------------------------------------------------------------------------
r6161 | simon | 2005-08-04 21:07:51 +0400 (, 04  2005) | 5 lines

Bug fix from James H: solve_game() was returning error messages in
the return value rather than in *error. In the old days type-
checking would have caught this, but now of course they're the same
type.

------------------------------------------------------------------------
r6160 | simon | 2005-08-04 15:16:10 +0400 (, 04  2005) | 26 lines

I am COMPLETELY GORMLESS. The Solo grid generator, when eliminating
clues from a filled grid, was using the algorithm

 - loop over the whole grid looking for a clue (or symmetry group of
   clues) which can be safely removed
 - remove it
 - loop over the whole grid again, and so on.

This was due to my vague feeling that removing one clue might affect
whether another can be removed. Of course this can happen - two
clues can be alternative ways of deducing the same vital fact so
that removing one makes the other necessary - but what _can't_
happen is for removing one clue to make another _become_ removable,
since you can only do that by _adding_ information. In other words,
after testing a clue and determining that it can't be removed, you
never need to test it again. Thus, a much simpler algorithm is

 - loop over the possible clues (or symmetry groups) _once_, in a
   random order
 - for each clue (group), if it is removable, remove it.

This still guarantees to leave the grid in a state where no further
clues can be removed, but it greatly cuts down puzzle generation
time and also simplifies the code. I am a fool for not having
spotted this in three and a half months!

------------------------------------------------------------------------
r6159 | simon | 2005-08-03 16:44:51 +0400 (, 03  2005) | 6 lines

Cleanups from James H: a few missing statics, a precautionary cast
or two, a debugging fix, a couple of explicit initialisations of
variables that were previously read uninitialised, and a fix for a
whopping great big memory leak in Slant owing to me having
completely forgotten to write free_game().

------------------------------------------------------------------------
r6158 | simon | 2005-08-03 15:06:16 +0400 (, 03  2005) | 6 lines

Slant uses the same generation strategy as Solo, despite not having
the property which devel.but claimed to be the reason why that
strategy works. A bit of thought revealed what the _real_ reason is
why this strategy works in some puzzles and not others, so I've
rewritten the paragraph to be more accurate.

------------------------------------------------------------------------
r6156 | simon | 2005-08-03 03:24:03 +0400 (, 03  2005) | 2 lines

Bah! There's _always_ one. Display glitch corrected.

------------------------------------------------------------------------
r6155 | simon | 2005-08-03 03:16:46 +0400 (, 03  2005) | 8 lines

New puzzle: `Slant', picked from the Japanese-language section of
nikoli.co.jp (which has quite a few puzzles that they don't seem to
have bothered to translate into English).

Minor structural change: the disjoint set forest code used in the
Net solver has come in handy again, so I've moved it out into its
own module dsf.c.

------------------------------------------------------------------------
r6153 | simon | 2005-08-01 15:27:01 +0400 (, 01  2005) | 6 lines

Various cleanups and clarifications to devel.but; some from Richard
B and some from me. Also an additional utility function
`random_copy' from Richard B, which he says is useful in a new
puzzle he's working on and which seems likely to come in handy again
at some point.

------------------------------------------------------------------------
r6152 | simon | 2005-07-31 18:56:18 +0400 (, 31  2005) | 8 lines

New end-game approach to Black Box. Instead of revealing the ball
positions immediately when you make an error, the game now reveals
as little information as is necessary to prove you wrong (including
none - if an existing laser path you know about is inconsistent with
your guesses, the game will just point it out and tell you nothing
new!) and you can try again. Errors are counted in much the same way
as deaths in Mines.

------------------------------------------------------------------------
r6151 | jacob | 2005-07-30 03:05:10 +0400 (, 30  2005) | 2 lines

missing `i' in `\e'

------------------------------------------------------------------------
r6150 | simon | 2005-07-29 20:45:52 +0400 (, 29  2005) | 8 lines

One more fix from Ben H. Also switched round the arena colour
selection in the redraw function, so that locked squares are no
longer displayed once the game is at an end. (It looked untidy and
disorienting for lighter-coloured locked squares to suddenly become
darker when the box was opened. You can still flip back and forth to
your previous game state using undo/redo if you want to compare the
results against your lock pattern.)

------------------------------------------------------------------------
r6149 | simon | 2005-07-29 16:07:10 +0400 (, 29  2005) | 14 lines

Various fixes and cleanups suggested by Ben Hutchings:
 - clarified wording of messages in validate_params(), including in
   particular a correction from `< 255' to `<= 255'
 - fixed random_upto() in game generation which caused the maximum
   number of balls never to be used when there was uncertainty
 - fixed widespread miscalculation of rectangular-array indices
   (multiplication by h instead of w, which would have broken
   non-square grids rather profoundly)
 - corrected an ANSI namespace violation
 - removed real functionality from the inside of assert()
   statements, so that the game should still work when compiled
   -DNDEBUG
 - couple of unnecessary linear-time loops removed.

------------------------------------------------------------------------
r6148 | simon | 2005-07-29 15:34:02 +0400 (, 29  2005) | 5 lines

Ben Hutchings reports that gcc 4 gives an optimiser warning because
it can't tell that one branch of a particular switch is always
taken. Adding a default clause with an automatic assertion failure
apparently fixes it.

------------------------------------------------------------------------
r6147 | simon | 2005-07-29 15:24:55 +0400 (, 29  2005) | 2 lines

Patches from Ben Hutchings to fix failures of sscanf error checking.

------------------------------------------------------------------------
r6144 | jacob | 2005-07-29 12:20:40 +0400 (, 29  2005) | 2 lines

Tweak a paragraph after discussion with Simon.

------------------------------------------------------------------------
r6142 | simon | 2005-07-28 21:12:18 +0400 (, 28  2005) | 3 lines

Shiny new developer documentation to replace the old sketchy HACKING
guide.

------------------------------------------------------------------------
r6137 | simon | 2005-07-24 14:39:33 +0400 (, 24  2005) | 8 lines

The very core of cross() is capable of suffering integer overflow on
large puzzles. Resort to hand-hacked 64-bit arithmetic for doing dot
products; everything else remains in `long' for the moment.

(Ideally I'd auto-detect the presence of `long long' and use it in
place of my cheap plastic imitation where possible, but since I
currently don't have a configure mechanism that'll have to wait.)

------------------------------------------------------------------------
r6136 | simon | 2005-07-24 14:09:04 +0400 (, 24  2005) | 6 lines

Another diagnostic mode for Untangle: if compiled with
`-DSHOW_CROSSINGS', it will show each edge in red if it is crossed
by anything, and in black otherwise. Distracting and not
particularly useful during play, but occasionally handy for
debugging cross().

------------------------------------------------------------------------
r6135 | simon | 2005-07-24 14:05:11 +0400 (, 24  2005) | 5 lines

(GTK only so far) Allow the argument passed to a game binary to be
either a game ID or a save file name. (The former takes priority,
because you can usually find a synonym for the latter, such as by
prepending `./' or `$PWD/'.)

------------------------------------------------------------------------
r6127 | simon | 2005-07-22 16:07:56 +0400 (, 22  2005) | 5 lines

Solve animation (currently only in Untangle) was failing to set
me->anim_pos to zero, meaning that if it happened immediately after
a completion flash then anim_pos would start off half way through
its run.

------------------------------------------------------------------------
r6126 | simon | 2005-07-22 15:55:50 +0400 (, 22  2005) | 8 lines

The `Solve' operation now rotates and/or reflects the solution grid
to bring it as close as possible to the current game state. This
means that if you request `Solve' after solving a puzzle yourself,
with the intention of finding out how similar your solution is to
the program's, then you will mostly see the differences in _shape_
rather than those being masked by the fact that yours happened to be
the other way up.

------------------------------------------------------------------------
r6125 | simon | 2005-07-22 15:06:57 +0400 (, 22  2005) | 10 lines

James H profiled the new Same Game grid generator and discovered it
was spending 60% of its time in shuffle(). The purpose of the
shuffle() call was to go through a largish array in random order
until we found an element that worked, so there's no actual need to
shuffle the whole array every time and I only did it out of
laziness. So I now pick a random element each time I go round the
loop, meaning I save a lot of shuffling effort whenever the loop
terminates early (which is often). I get about a factor of two speed
improvement from this small change.

------------------------------------------------------------------------
r6124 | simon | 2005-07-21 22:06:31 +0400 (, 21  2005) | 24 lines

Until now, Same Game has been the only puzzle in this collection
which is unable to guarantee that every grid it generates can be
solved. So I'm eliminating that exception: this checkin contains a
more sophisticated grid generator which does guarantee solubility.
It's a bit slow (most noticeably on the 15x10c3 preset), and the
quality of the generated grids is slightly weird (a tendency toward
small regions rather than large sweeping areas of contiguous
colour); however, I'm willing to see the latter as a feature for
now, since making the game more challenging while simultaneously
guaranteeing it to be possible sounds like an all-round win to me.

From now on I'm raising my standards for contributions to this
collection. I made this fix to Same Game because I heard a user
_automatically assume_ that any puzzle in my collection would not be
so uncouth as to generate an impossible grid; as of this checkin
that's actually true, and I intend to maintain that standard of
quality henceforth.

(Guaranteeing a _unique_ solution is more of an optional extra,
since there are many games for which it isn't a meaningful concept
or isn't particularly desirable. Which is not to say that _some_
games wouldn't be of unacceptably low quality if they failed to
guarantee uniqueness; it depends on the game.)

------------------------------------------------------------------------
r6123 | simon | 2005-07-21 21:26:46 +0400 (, 21  2005) | 6 lines

I've been meaning to do this for ages: all the Makefiles now give
$(XFLAGS) _after_ $(CFLAGS) on the compiler command lines, meaning
that you can provide options in XFLAGS on the makefile which will
override the ones in CFLAGS. For example, `make XFLAGS=-O0' to make
debugging easier.

------------------------------------------------------------------------
r6122 | jacob | 2005-07-21 03:35:43 +0400 (, 21  2005) | 2 lines

Sync with website

------------------------------------------------------------------------
r6121 | simon | 2005-07-20 15:05:35 +0400 (, 20  2005) | 6 lines

The Untangle completion flash was weedy and anaemic; beef it up a
bit. In particular, it now flashes between _two_ specially picked
colours (white and mid-grey), meaning that it should be visible even
if your default background colour is white; and it also flashes
twice rather than once.

------------------------------------------------------------------------
r6120 | jacob | 2005-07-19 23:33:49 +0400 (, 19  2005) | 3 lines

Some attempt to explain Dominosa for those unfamiliar with dominos. (Not sure
I've succeeded.)

------------------------------------------------------------------------
r6118 | simon | 2005-07-18 23:07:36 +0400 (, 18  2005) | 3 lines

Another fix from Chris: Guess's allow-blanks mode wasn't allowing
blanks...

------------------------------------------------------------------------
r6117 | simon | 2005-07-18 22:54:06 +0400 (, 18  2005) | 2 lines

Fix to Chris's patch in r6106 (also from Chris).

------------------------------------------------------------------------
r6114 | simon | 2005-07-17 21:12:21 +0400 (, 17  2005) | 4 lines

Switch Untangle to using `long' rather than `int' in its internal
rationals, for the sake of 16-bit-int platforms such as Palm. Thanks
to James H.

------------------------------------------------------------------------
r6113 | simon | 2005-07-17 21:10:11 +0400 (, 17  2005) | 3 lines

Quite a few instances of the Cardinal Error of Ctype were turned up
by a grep I just did. Oops.

------------------------------------------------------------------------
r6111 | simon | 2005-07-17 18:49:13 +0400 (, 17  2005) | 2 lines

Two tiny cleanup patches from James H.

------------------------------------------------------------------------
r6107 | simon | 2005-07-17 16:12:16 +0400 (, 17  2005) | 4 lines

Get rid of the malloc in shuffle(), by defining a subfunction
memswap() which declares a fixed-size buffer on the stack and uses
it multiple times if necessary.

------------------------------------------------------------------------
r6106 | simon | 2005-07-17 15:15:50 +0400 (, 17  2005) | 4 lines

Patch from Chris Emerson: rather than dynamically calling
get_correct() at (among other things) every redraw, we call it once
at the creation of a new game_state to save CPU.

------------------------------------------------------------------------
r6105 | jacob | 2005-07-17 14:33:40 +0400 (, 17  2005) | 3 lines

Black Box: fix "reveal" button location, explain what's meant by the
`firing range'

------------------------------------------------------------------------
r6104 | jacob | 2005-07-17 14:13:41 +0400 (, 17  2005) | 2 lines

Use \q{} and \by in Black Box docs.

------------------------------------------------------------------------
r6103 | simon | 2005-07-17 13:35:01 +0400 (, 17  2005) | 3 lines

I keep forgetting to do things when adding a new puzzle, so here's a
checklist.

------------------------------------------------------------------------
r6101 | simon | 2005-07-17 12:46:00 +0400 (, 17  2005) | 2 lines

Bah, there's always one: failed to `svn add' blackbox.c itself!

------------------------------------------------------------------------
r6100 | simon | 2005-07-17 12:44:18 +0400 (, 17  2005) | 2 lines

Another game from James H: `Black Box'.

------------------------------------------------------------------------
r6099 | simon | 2005-07-17 00:06:37 +0400 (, 17  2005) | 2 lines

Cleanups and memory leak fixes from James H.

------------------------------------------------------------------------
r6098 | simon | 2005-07-17 00:02:15 +0400 (, 17  2005) | 7 lines

Sanity-checking patch from Phil Bordelon: since Solo can't cope with
more than 36 distinct symbols (it runs out of alphanumerics), check
this in validate_params. I hate to do this, since I like puzzle
sizes to at least be open-ended in _principle_, but in this case
there's a fundamental UI limitation which won't be fixed by getting
a faster CPU.

------------------------------------------------------------------------
r6097 | simon | 2005-07-16 23:51:53 +0400 (, 16  2005) | 12 lines

New puzzle: `Untangle', cloned (with the addition of random grid
generation) from a simple but rather fun Flash game I saw this
morning.

Small infrastructure change for this puzzle: while most game
backends find the midend's assumption that Solve moves are never
animated to be a convenience absolving them of having to handle the
special case themselves, this one actually needs Solve to be
animated. Rather than break that convenience for the other puzzles,
I've introduced a flag bit (which I've shoved in mouse_priorities
for the moment, shamefully without changing its name).

------------------------------------------------------------------------
r6096 | simon | 2005-07-15 20:43:02 +0400 (, 15  2005) | 5 lines

Improve speed of grid generation: I've found something simple I can
do during construction which massively increases (by over a factor
of four with default parameters) the probability that any given
randomly generated grid will be uniquely solvable.

------------------------------------------------------------------------
r6094 | jacob | 2005-07-15 02:50:58 +0400 (, 15  2005) | 2 lines

Add Dominosa printout support.

------------------------------------------------------------------------
r6093 | simon | 2005-07-14 22:15:23 +0400 (, 14  2005) | 7 lines

Cleanups to Solo:
 - use the new `shuffle' utility function in a couple of places
 - remove the random_state parameter from solver(). It was there
   because I initially wanted to use the same solver for grid
   generation, but since I had to abandon that plan the solver now
   doesn't have any need for randomness at all.

------------------------------------------------------------------------
r6091 | simon | 2005-07-14 21:42:01 +0400 (, 14  2005) | 2 lines

New puzzle: Dominosa.

------------------------------------------------------------------------
r6090 | simon | 2005-07-14 21:37:05 +0400 (, 14  2005) | 2 lines

Introduce a `shuffle' utility function.

------------------------------------------------------------------------
r6088 | simon | 2005-07-10 14:17:13 +0400 (, 10  2005) | 9 lines

game_timing_state() now has access to the game_ui. This means that
whether the timer is currently going is no longer solely dependent
on the current game_state: it can be dependent on more persistent
information stored in the game_ui. In particular, Mines now freezes
the timer permanently once you complete a grid for the first time,
so that you can then backtrack through your solution process without
destroying the information about how long it took you the first time
through.

------------------------------------------------------------------------
r6087 | simon | 2005-07-10 14:06:04 +0400 (, 10  2005) | 19 lines

Change of policy on game_changed_state(). Originally, it was called
by the midend every time the game state changed _other_ than as a
result of make_move(), on the basis that when the game state changed
due to make_move() the game backend had probably noticed anyway.
However, when make_move() split up, this became more fiddly: if the
game_ui had to be updated based on some property of the final game
state, then execute_move() couldn't do it because it didn't have a
pointer to the game_ui, but it was fiddly to do it in
interpret_move() because that didn't directly have a copy of the
finished game state to examine. Same Game (the only game to be
affected) had to deal with this by actually having interpret_move()
_call_ execute_move() to construct a temporary new game state,
update the UI, and then throw it away.

So now, game_changed_state() is called _every_ time the current game
state changes, which means that if anything needs doing to the
game_ui as a result of examining the new game state, it can be done
there and save a lot of effort.

------------------------------------------------------------------------
r6086 | simon | 2005-07-10 13:27:08 +0400 (, 10  2005) | 10 lines

Subtle UI change to Mines. Although I mostly find the unified left-
button interface (same button to open a closed square or to clear
around an open one) to be a massive help, there is one circumstance
in which it frequently kills me: if I click down on an open square I
want to clear around, then the mouse pointer accidentally drifts
over on to the nearest closed square before I release, I'll end up
opening that square instead and (usually) dying. So this checkin
causes Mines to note which type of square I left-clicked on, and to
do nothing if the button release is on the other type.

------------------------------------------------------------------------
r6083 | simon | 2005-07-09 14:19:41 +0400 (, 09  2005) | 6 lines

Alter the `Octagon' board preset so that instead of presenting you
with the obvious central hole it presents you with a randomly chosen
one of twelve other holes. The reason is, the central-hole starting
position is provably insoluble (proof given in comments), so instead
we pick from the ones that are actually possible.

------------------------------------------------------------------------
r6079 | simon | 2005-07-07 01:24:28 +0400 (, 07  2005) | 3 lines

Missing quit on error was leading to an assertion failure on some
types of incorrectly formatted save file.

------------------------------------------------------------------------
r6078 | jacob | 2005-07-07 00:10:03 +0400 (, 07  2005) | 2 lines

Move various printf()s after declarations.

------------------------------------------------------------------------
r6077 | simon | 2005-07-06 22:36:20 +0400 (, 06  2005) | 23 lines

Unify the two solvers in Solo. nsolve has now had recursion
capability added to it, to be used only when all else fails, and is
simply called `solver'. This means that:

 - solving of 5x5 Trivial grids using the `Solve' function, which
   previously hung for ages because rsolve happened to take a wrong
   turning at the start, is now zippy
 - solosolver doesn't require the confusing -r and -n options
 - solosolver can show its working even for Unreasonable grids.

Unfortunately, the new unified solver still isn't suitable for grid
generation. After it proved to be so much faster at solving 5x5s, I
hoped to be able to substitute it for rsolve during generation and
gain additional speed in 5x5 generation too; but no luck, because
it's slower _per recursion level_, and although during solving it
makes up for this by needing very few levels, there is a lot of
_unavoidable_ recursion during generation, especially at 5x5. A
hybrid strategy which starts off with rsolve and switches to the
unified solver at a critical point proved unsatisfactory as well,
because the critical point changes depending on the vagaries of the
recursion and can't be pinpointed easily. So rsolve is still in
there, only renamed `gridgen' because that's now all it's good for.

------------------------------------------------------------------------
r6076 | simon | 2005-07-06 22:27:40 +0400 (, 06  2005) | 4 lines

Refactoring from James H: the highlight and lowlight colour setup
common to Fifteen, Sixteen, Twiddle and Pegs is now a utility
function in misc.c.

------------------------------------------------------------------------
r6070 | simon | 2005-07-06 15:06:17 +0400 (, 06  2005) | 11 lines

Some patches from James H:
 - reinstate the initialisation of ds->w and ds->h in guess.c, which
   I'd accidentally removed during game_size() refactoring
 - reorganise Net's interpret_move() so that my uncommitted patch
   for drag-based UI (which he uses on the Palm port) will apply
   more easily
 - the interpret_move() changes make it easy to have a single move
   type which rotates a tile by 180 degrees, so this is now provided
   via the `F' key (but there's no spare button available to provide
   it via the mouse).

------------------------------------------------------------------------
r6069 | jacob | 2005-07-06 01:40:29 +0400 (, 06  2005) | 4 lines

Revert the code that assumed that incoming parameters used a random generation
scheme in r6068, since this messed up the non-permanency of the non-limited
parameter.

------------------------------------------------------------------------
r6068 | jacob | 2005-07-06 01:27:19 +0400 (, 06  2005) | 8 lines

Add a `full' parameter to validate_params(), analogous to the one in
encode_params(). This is necessary for cases where generation-time parameters
that are normally omitted from descriptive IDs can place restrictions on other
parameters; in particular, when the default value of a relevant generation-time
parameter is not the one used to generate the descriptive ID, validation could
reject self-generated IDs (e.g., Net `5x2w:56182ae7c2', and some cases in
`Pegs').

------------------------------------------------------------------------
r6066 | simon | 2005-07-05 23:40:32 +0400 (, 05  2005) | 8 lines

Enhancements to mkfiles.pl and Recipe to arrange for the auxiliary
command-line programs (solosolver, patternsolver, mineobfusc) to be
built as part of the normal Makefiles. This means mkfiles.pl now has
the capability to compile a source file more than once with
different #defines. Also, fixes for those auxiliary programs and one
fix in midend.c which the Borland compiler objected to while I was
testing its makefile generation.

------------------------------------------------------------------------
r6065 | jacob | 2005-07-05 23:38:27 +0400 (, 05  2005) | 2 lines

It's been a new year for a while now.

------------------------------------------------------------------------
r6064 | jacob | 2005-07-05 23:12:56 +0400 (, 05  2005) | 2 lines

revert supposed typo -- I have no brain

------------------------------------------------------------------------
r6063 | jacob | 2005-07-05 23:11:51 +0400 (, 05  2005) | 2 lines

Add HACKING to main doc build.

------------------------------------------------------------------------
r6062 | jacob | 2005-07-05 23:10:26 +0400 (, 05  2005) | 2 lines

typo

------------------------------------------------------------------------
r6061 | jacob | 2005-07-05 22:57:34 +0400 (, 05  2005) | 2 lines

Add a completion flash when you get down to a single peg.

------------------------------------------------------------------------
r6060 | simon | 2005-07-05 22:14:03 +0400 (, 05  2005) | 2 lines

Add `pegs' to svn:ignore.

------------------------------------------------------------------------
r6059 | simon | 2005-07-05 22:13:31 +0400 (, 05  2005) | 10 lines

Refactored the game_size() interface, which was getting really
unpleasant and requiring lots of special cases to be taken care of
by every single game. The new interface exposes an integer `tile
size' or `scale' parameter to the midend and provides two much
simpler routines: one which computes the pixel window size given a
game_params and a tile size, and one which is given a tile size and
must set up a drawstate appropriately. All the rest of the
complexity is handled in the midend, mostly by binary search, so
grubby special cases only have to be dealt with once.

------------------------------------------------------------------------
r6058 | simon | 2005-07-05 16:03:56 +0400 (, 05  2005) | 2 lines

James Harvey points out a missing ifdef.

------------------------------------------------------------------------
r6057 | jacob | 2005-07-05 01:07:40 +0400 (, 05  2005) | 2 lines

Clarify that diagonal moves are not permitted in Pegs.

------------------------------------------------------------------------
r6056 | jacob | 2005-07-05 00:06:35 +0400 (, 05  2005) | 2 lines

Add WinHelp topic.

------------------------------------------------------------------------
r6054 | simon | 2005-07-04 23:55:10 +0400 (, 04  2005) | 2 lines

There's always one. Forgot to add Pegs to `make install'.

------------------------------------------------------------------------
r6053 | simon | 2005-07-04 23:53:36 +0400 (, 04  2005) | 2 lines

Documentation for Pegs.

------------------------------------------------------------------------
r6052 | simon | 2005-07-04 23:42:55 +0400 (, 04  2005) | 4 lines

Peg Solitaire implementation, complete with a random board
generator. The generator is lacking in almost any kind of finesse,
but it produces puzzles which at least _I_ find plausibly puzzling.

------------------------------------------------------------------------
r6051 | jacob | 2005-07-04 18:35:14 +0400 (, 04  2005) | 2 lines

Document keyboard controls for Flip

------------------------------------------------------------------------
r6050 | jacob | 2005-07-04 15:21:50 +0400 (, 04  2005) | 2 lines

Fix bounds checking for Flip cursor control.

------------------------------------------------------------------------
r6049 | simon | 2005-07-03 18:49:00 +0400 (, 03  2005) | 2 lines

James H's patch for a keyboard-controlled cursor in Flip.

------------------------------------------------------------------------
r6048 | simon | 2005-07-03 15:45:49 +0400 (, 03  2005) | 10 lines

Allow game backends to use even special keystrokes such as N and Q;
they will only be processed as special by the midend if unwanted by
the backend. This causes 5x5 Solo to become just about playable,
because you can now click in a square and type `n'. However, typing
`n' when a square is not selected will revert to the normal
behaviour of starting a new game.

(This isn't particularly ideal, I know, but it's better than
nothing.)

------------------------------------------------------------------------
r6047 | simon | 2005-07-03 13:35:29 +0400 (, 03  2005) | 16 lines

draw_polygon() and draw_circle() have always had a portability
constraint: because some front ends interpret `draw filled shape' to
mean `including its boundary' while others interpret it to mean `not
including its boundary' (and X seems to vacillate between the two
opinions as it moves around the shape!), you MUST NOT draw a filled
shape only. You can fill in one colour and outline in another, you
can fill or outline in the same colour, or you can just outline, but
just filling is a no-no.

This leads to a _lot_ of double calls to these functions, so I've
changed the interface. draw_circle() and draw_polygon() now each
take two colour arguments, a fill colour (which can be -1 for none)
and an outline colour (which must be valid). This should simplify
code in the game back ends, while also reducing the possibility for
coding error.

------------------------------------------------------------------------
r6045 | simon | 2005-07-01 20:50:49 +0400 (, 01  2005) | 7 lines

James Harvey points out that entering an invalid game ID can affect
the current midend state even if you don't subsequently enter a
valid one. Reorganise midend_game_id_int() so that (just like
midend_deserialise()) it does all its error checking before altering
anything in the midend's persistent data, so that it either succeeds
completely or fails before doing anything at all.

------------------------------------------------------------------------
r6044 | simon | 2005-06-30 22:11:41 +0400 (, 30  2005) | 5 lines

Prevent drags from being started outside the playing area, which was
causing invalid move descriptions to be returned from
interpret_move() and then failing an assertion when execute_move()
refused them.

------------------------------------------------------------------------
r6043 | simon | 2005-06-30 22:11:02 +0400 (, 30  2005) | 4 lines

Preset names retrieved from the environment must be dupstr()ed. How
did I miss this before? It just caused a segfault for me, which is
entirely fair enough, but I've no idea why it didn't fail before!

------------------------------------------------------------------------
r6042 | simon | 2005-06-30 22:00:37 +0400 (, 30  2005) | 4 lines

Load and Save are now supported on all three desktop platforms, and
documented. (This means the GTK temporary dependency on an
environment variable is now gone.)

------------------------------------------------------------------------
r6041 | simon | 2005-06-30 13:07:00 +0400 (, 30  2005) | 10 lines

General robustness patch from James Harvey:
 - most game_size() functions now work in doubles internally and
   round to nearest, meaning that they have less tendency to try to
   alter a size they returned happily from a previous call
 - couple of fiddly fixes (memory leaks, precautionary casts in
   printf argument lists)
 - midend_deserialise() now constructs an appropriate drawstate,
   which I can't think how I overlooked myself since I _thought_ I
   went through the entire midend structure field by field!

------------------------------------------------------------------------
r6040 | simon | 2005-06-30 12:25:47 +0400 (, 30  2005) | 4 lines

Attempting to begin a drag from (i.e. just click on) the hint pegs
for a past guess caused strangeness up to and including segfault,
thanks to bad bounds checking. Well spotted John Sullivan.

------------------------------------------------------------------------
r6037 | simon | 2005-06-29 20:32:53 +0400 (, 29  2005) | 3 lines

Add a cast whose absence was causing a (-Werror-exacerbated) compile
warning on OS X.

------------------------------------------------------------------------
r6036 | simon | 2005-06-29 16:19:08 +0400 (, 29  2005) | 4 lines

Validation of random-state-type game descriptions was broken. This
meant that a Mines game saved before the first click had taken place
could not be successfully reloaded.

------------------------------------------------------------------------
r6033 | simon | 2005-06-29 12:20:49 +0400 (, 29  2005) | 3 lines

When serialising this game, it's probably better to keep the
half-finished guess in the game_ui rather than throwing it away.

------------------------------------------------------------------------
r6032 | jacob | 2005-06-28 22:10:20 +0400 (, 28  2005) | 2 lines

Make peg removal accessible from the keyboard.

------------------------------------------------------------------------
r6031 | simon | 2005-06-28 21:43:50 +0400 (, 28  2005) | 2 lines

New {en,de}code_ui functions should be static. Oops.

------------------------------------------------------------------------
r6030 | simon | 2005-06-28 21:05:05 +0400 (, 28  2005) | 9 lines

Actually implemented the serialise/deserialise functions in
midend.c. Also I've added an experimental front end in gtk.c only:
`Save' and `Load' options on the Game menu, which don't even show up
unless you define the magic environment variable
PUZZLES_EXPERIMENTAL_SAVE. Once I'm reasonably confident that the
whole edifice is plausibly stable, I'll take that out and turn it
into a supported feature (and also implement it in OS X and Windows
and write documentation).

------------------------------------------------------------------------
r6029 | simon | 2005-06-28 15:14:09 +0400 (, 28  2005) | 9 lines

More serialisation changes: the game_aux_info structure has now been
retired, and replaced with a simple string. Most of the games which
use it simply encode the string in the same way that the Solve move
will also be encoded, i.e. solve_game() simply returns
dupstr(aux_info). Again, this is a better approach than writing
separate game_aux_info serialise/deserialise functions because doing
it this way is self-testing (the strings are created and parsed
during the course of any Solve operation at all).

------------------------------------------------------------------------
r6028 | simon | 2005-06-28 12:35:55 +0400 (, 28  2005) | 2 lines

Rogue diagnostic!

------------------------------------------------------------------------
r6027 | simon | 2005-06-28 12:06:56 +0400 (, 28  2005) | 2 lines

Move a rogue declaration to the top of its block.

------------------------------------------------------------------------
r6026 | simon | 2005-06-28 11:33:49 +0400 (, 28  2005) | 8 lines

Another function pair required for serialisation; these ones save
and restore anything vitally important in the game_ui. Most of the
game_ui is expected to be stuff about cursor positions and currently
active mouse drags, so it absolutely _doesn't_ want to be preserved
over a serialisation; but one or two things would be disorienting or
outright wrong to reset, such as the Net origin position and the
Mines death counter.

------------------------------------------------------------------------
r6025 | simon | 2005-06-28 10:59:27 +0400 (, 28  2005) | 14 lines

Annoying special cases for Mines.

Firstly, the `Restart' function now reconstructs an initial game
state from the game description rather than dup_game(states[0]).
This means that Restart in a game of Mines restarts to just _after_
the initial click, so you can resume the puzzle-solving part without
having to remember where you placed that click.

Secondly, the midend now contains a second `private' game desc,
which is guaranteed to actually reconstruct the initial game_state
correctly (which Mines's publicly visible game descs tend not to,
since they describe a state which has already had the first click).
This should make serialising of Mines more sensible.

------------------------------------------------------------------------
r6024 | simon | 2005-06-27 23:34:54 +0400 (, 27  2005) | 28 lines

Re-architecting of the game backend interface. make_move() has been
split into two functions. The first, interpret_move(), takes all the
arguments that make_move() used to get and may have the usual side
effects of modifying the game_ui, but instead of returning a
modified game_state it instead returns a string description of the
move to be made. This string description is then passed to a second
function, execute_move(), together with an input game_state, which
is responsible for actually producing the new state. (solve_game()
also returns a string to be passed to execute_move().)

The point of this is to work towards being able to serialise the
whole of a game midend into a byte stream such as a disk file, which
will eventually support save and load functions in the desktop
puzzles, as well as restoring half-finished games after a quit and
restart in James Harvey's Palm port. Making each game supply a
convert-to-string function for its game_state format would have been
an unreliable way to do this, since those functions would not have
been used in normal play, so they'd only have been tested when you
actually tried to save and load - a recipe for latent bugs if ever I
heard one. This way, you won't even be able to _make_ a move if
execute_move() doesn't work properly, which means that if you can
play a game at all I can have pretty high confidence that
serialising it will work first time.

This is only the groundwork; there will be more checkins to come on
this theme. But the major upheaval should now be done, and as far as
I can tell everything's still working normally.

------------------------------------------------------------------------
r6023 | simon | 2005-06-26 17:12:34 +0400 (, 26  2005) | 2 lines

Fix GTK casts to restore correct compilation on GTK 2.0 after r6022.

------------------------------------------------------------------------
r6022 | jacob | 2005-06-26 16:54:08 +0400 (, 26  2005) | 5 lines

Under Gtk 1.2 (at least on Debian woody), a config or preset change that would
otherwise not cause the window size to change caused it to become very small
indeed. This change from Simon fixes that behaviour; I haven't tested it with
Gtk 2.

------------------------------------------------------------------------
r6018 | jacob | 2005-06-25 21:24:03 +0400 (, 25  2005) | 2 lines

Add debugging support.

------------------------------------------------------------------------
r6014 | jacob | 2005-06-25 17:52:52 +0400 (, 25  2005) | 2 lines

Further additions to the Guess docs.

------------------------------------------------------------------------
r6013 | jacob | 2005-06-25 17:43:45 +0400 (, 25  2005) | 3 lines

Make the keyboard-control cursors visible whenever a keyboard control is
activated.

------------------------------------------------------------------------
r6012 | jacob | 2005-06-25 17:24:19 +0400 (, 25  2005) | 4 lines

The AngleArc() function that was being used to draw circles on Windows turns
out to be unsupported on the Win9x/Me series. Use Arc() instead (tested on
Win98 and Win2K).

------------------------------------------------------------------------
r6011 | simon | 2005-06-24 20:35:42 +0400 (, 24  2005) | 2 lines

Couple of presets.

------------------------------------------------------------------------
r6010 | simon | 2005-06-24 20:35:27 +0400 (, 24  2005) | 6 lines

More patches from James Harvey: enforce a maximum brightness in the
background colour (to ensure white pegs show up against it), and
convert the keyboard-control cursor into a rectangle when it's over
the hint pegs (otherwise it looks rather silly for numbers of pegs
above 4).

------------------------------------------------------------------------
r6009 | simon | 2005-06-24 16:30:30 +0400 (, 24  2005) | 5 lines

Fix another display/UI glitch which triggered if you filled a row
(so that the hint pegs lit up as `ready') and then pressed Undo: the
markable flag would remain set and the redrawing wouldn't darken the
pegs again.

------------------------------------------------------------------------
r6008 | simon | 2005-06-24 15:13:08 +0400 (, 24  2005) | 3 lines

Turn off the keyboard-control cursor when the user reverts to mouse
control.

------------------------------------------------------------------------
r6007 | simon | 2005-06-24 15:05:43 +0400 (, 24  2005) | 3 lines

Change the preprocessor symbol `DEBUG' to `DEBUGGING', since the
former is automatically defined by Cygwin.

------------------------------------------------------------------------
r6006 | simon | 2005-06-24 15:03:20 +0400 (, 24  2005) | 10 lines

My background-erasing changes in r5996/r5997 caused trouble with the
keyboard-control cursors, and when I tried to fix those more
wallpaper bubbles popped up elsewhere. Here's what I think is a
proper fix: a comprehensive overhaul of the redraw code such that,
instead of tracking the cursor positions explicitly in the
drawstate, we instead track for each peg position whether or not a
cursor is currently displayed at that position. So cursor erasing
and cursor drawing become part of the main draw loop rather than a
separate bit on the end.

------------------------------------------------------------------------
r6005 | simon | 2005-06-24 03:11:59 +0400 (, 24  2005) | 2 lines

Array overflow fix from James Harvey.

------------------------------------------------------------------------
r6004 | jacob | 2005-06-24 02:01:17 +0400 (, 24  2005) | 3 lines

Make the `hold marker' in Guess accessible from the keyboard (`H' key, for want
of a better idea).

------------------------------------------------------------------------
r6003 | jacob | 2005-06-24 01:47:55 +0400 (, 24  2005) | 2 lines

Factual and other corrections/additions to the Guess docs.

------------------------------------------------------------------------
r6002 | jacob | 2005-06-24 01:37:05 +0400 (, 24  2005) | 2 lines

Reinstate WinHelp topic now we have a manual chapter.

------------------------------------------------------------------------
r6000 | simon | 2005-06-23 23:01:01 +0400 (, 23  2005) | 2 lines

Credit James Harvey.

------------------------------------------------------------------------
r5999 | simon | 2005-06-23 22:50:58 +0400 (, 23  2005) | 3 lines

James Harvey's extensions to Guess: a couple of extra game settings
plus a manual chapter.

------------------------------------------------------------------------
r5998 | simon | 2005-06-23 22:05:19 +0400 (, 23  2005) | 2 lines

And forgot to add guess to the Unix make install target! I need a list.

------------------------------------------------------------------------
r5997 | simon | 2005-06-23 22:02:21 +0400 (, 23  2005) | 3 lines

Bah, not good enough. Extend those background erases by one more
pixel.

------------------------------------------------------------------------
r5996 | simon | 2005-06-23 21:43:43 +0400 (, 23  2005) | 4 lines

Erase backgrounds when drawing over an existing circle, for the
benefit of antialiasing platforms such as OS X. Also in this
checkin, fiddle with svn:ignore (there's a new puzzle binary).

------------------------------------------------------------------------
r5995 | simon | 2005-06-23 20:36:09 +0400 (, 23  2005) | 9 lines

Allow dragging of coloured pegs from previous guesses. Also
reorganise the colours so there are fewer of those terribly
computery cyan and magenta shades, and more good old-fashioned
colours with simple names like orange and purple. Finally, change
the `right place' marking peg colour from red to black, in line with
at least _my_ old Mastermind set (I faintly suspect red marker pegs
of being an Americanism) and also so that the marker pegs and the
coloured pegs have no colours in common.

------------------------------------------------------------------------
r5994 | simon | 2005-06-23 16:55:47 +0400 (, 23  2005) | 3 lines

Must outline as well as filling circles, because not all platforms
can be guaranteed to draw bare filled shapes the same way.

------------------------------------------------------------------------
r5993 | simon | 2005-06-23 16:21:14 +0400 (, 23  2005) | 4 lines

Two small fixes: add some ceil() calls to stop the puzzle shrinking
every time I press N, and revert the help topic to NULL until some
documentation materialises.

------------------------------------------------------------------------
r5992 | simon | 2005-06-23 13:14:19 +0400 (, 23  2005) | 5 lines

`Guess', a Mastermind clone from James Harvey. This checkin also
introduces a few new utility functions in misc.c, one of which is
the bitmap obfuscator from Mines (which has therefore been moved out
of mines.c).

------------------------------------------------------------------------
r5991 | simon | 2005-06-23 12:24:52 +0400 (, 23  2005) | 2 lines

Introduce a front-end function to draw circles.

------------------------------------------------------------------------
r5988 | simon | 2005-06-22 13:26:03 +0400 (, 22  2005) | 2 lines

This TODO comment should have been taken out in r5913 :-)

------------------------------------------------------------------------
r5987 | simon | 2005-06-22 12:30:31 +0400 (, 22  2005) | 5 lines

New front end functions to save and restore a region of the puzzle
bitmap. Can be used to implement sprite-like animations: for
example, useful for games that wish to implement a user interface
which involves dragging an object around the playing area.

------------------------------------------------------------------------
r5984 | jacob | 2005-06-21 15:16:36 +0400 (, 21  2005) | 2 lines

Add WinHelp topic

------------------------------------------------------------------------
r5983 | simon | 2005-06-21 12:15:53 +0400 (, 21  2005) | 6 lines

Patch from James Harvey in response to the new Rectangles grid
generator: (a) take out the `#ifdef SLOW_SYSTEM' because the new
generator is much more efficient, and (b) convert another int to
size_t to prevent the solver going negative in 16-bit ints as a
result.

------------------------------------------------------------------------
r5982 | simon | 2005-06-20 21:32:45 +0400 (, 20  2005) | 32 lines

Conversation with Richard and Chris yesterday gave rise to a more
sensible means of generating an initial gridful of rectangles. This
was previously a stupidly non-scalable bit of the Rectangles puzzle
generator: it filled a ludicrously large array with every possible
rectangle that could go anywhere in the grid, picked one at random
and winnowed the list by removing anything that overlapped that one,
then repeated until the list was empty (and therefore the grid was
full except for remaining singleton squares). Total cost was O(N^4)
in both time and space; not pretty.

Richard and Chris's sensible alternative was to place each rectangle
by randomly choosing a so-far-uncovered _square_, and then picking a
random rectangle from the possible ones covering that square. This
means we only have to deal with a small fragment of the rectangle
list at any one time, and we don't have to store the whole lot in
memory; so it's _much_ faster and more scalable, and has virtually
no memory cost.

A side effect of this algorithmic change is that the probability
distribution has altered. When you line up all the possible
_rectangles_ and pick one at random, then obviously the small ones
are going to be in the majority since lots of small ones can fit
into the space taken up by any given big one. So the original
algorithm tends to favour fiddly grids full of lots of tiny
rectangles, which don't tend to be very interesting. But if you
first pick a square and then think about the rectangles that can
surround that square, the small ones are suddenly going to be in the
_minority_ because there are only two ways you can place (say) a 2x1
containing a given square compared to 36 ways you can place a 6x6.
So this algorithm favours more large rectangles, which I generally
consider to be an improvement.

------------------------------------------------------------------------
r5980 | simon | 2005-06-20 01:49:53 +0400 (, 20  2005) | 2 lines

James Harvey's memory leak patch for Flip.

------------------------------------------------------------------------
r5979 | simon | 2005-06-19 18:33:06 +0400 (, 19  2005) | 9 lines

Redraw glitch: tiles marked black (at game-over time) were not
redrawn as non-black on undo. Introduce a new flag TILE_IMPOSSIBLE,
so that information about those black markers is cached in the
drawstate and we know when we have to erase them.

In the process I've removed the game_state argument completely from
the subfunction tile_redraw(), which gives me some confidence that
it isn't getting any _more_ privileged information out of it.

------------------------------------------------------------------------
r5975 | simon | 2005-06-18 12:52:50 +0400 (, 18  2005) | 8 lines

Just noticed yesterday that initial window sizing is broken on
Windows for puzzles with status bars, because the initial call to
check_window_size is given the window size _without_ the status bar
and assumes that that has to be big enough for the whole thing
_with_ the status bar, so it shrinks everything by a little bit. So
now we resize the window to take account of the status bar before
calling check_window_size(), and the problem seems to have gone away.

------------------------------------------------------------------------
r5974 | simon | 2005-06-18 12:46:33 +0400 (, 18  2005) | 3 lines

I've decided I didn't like the asymmetry of putting the solution
markers in the top left of the square.

------------------------------------------------------------------------
r5973 | simon | 2005-06-18 12:36:52 +0400 (, 18  2005) | 2 lines

I'm sick of not having a `make install' target.

------------------------------------------------------------------------
r5972 | simon | 2005-06-17 23:06:25 +0400 (, 17  2005) | 2 lines

Correct rogue chapter into a subheading.

------------------------------------------------------------------------
r5970 | simon | 2005-06-17 22:55:36 +0400 (, 17  2005) | 2 lines

Solver for Flip.

------------------------------------------------------------------------
r5969 | simon | 2005-06-17 22:54:58 +0400 (, 17  2005) | 4 lines

Infrastructure change which I've been thinking about for a while:
the back end function solve_game() now takes the _current_
game_state in addition to the initial one.

------------------------------------------------------------------------
r5968 | simon | 2005-06-17 21:32:28 +0400 (, 17  2005) | 2 lines

Animation.

------------------------------------------------------------------------
r5967 | simon | 2005-06-17 21:16:49 +0400 (, 17  2005) | 6 lines

Another new puzzle! This one isn't particularly deep or complex
(solving it only requires matrix inversion over GF(2), whereas
several of the other puzzles in this collection are NP-complete in
principle), but it's a fun enough thing to play with and is
non-trivial to do in your head - especially on the hardest preset.

------------------------------------------------------------------------
r5965 | simon | 2005-06-17 15:51:52 +0400 (, 17  2005) | 11 lines

An email conversation with Chuck Fresno turned up several forms of
symmetry which were not implemented in Solo. Now they are.

In the process I've completely retired symmetry_limit() on the
grounds that some of the new symmetries do not have a rectangular
base region; instead I determine the base region by going through
the grid and finding every square which is not transformed into a
lexicographically lower square by any symmetry operation. This means
that adding new symmetries is now _only_ a matter of encoding the
actual transformation rules.

------------------------------------------------------------------------
r5941 | simon | 2005-06-10 17:05:24 +0400 (, 10  2005) | 4 lines

Clean up the behaviour of drags off the edge of the grid. These have
always been a convenient way to cancel a drag you decided was an
error, but now it's more obvious that this is the case.

------------------------------------------------------------------------
r5940 | simon | 2005-06-10 15:34:02 +0400 (, 10  2005) | 2 lines

Disable shuffle overlap checking in the special case w=h=n.

------------------------------------------------------------------------
r5939 | simon | 2005-06-10 15:29:59 +0400 (, 10  2005) | 3 lines

Overzealous last-move tracking during shuffle was causing lockups on
2x2 grid generation.

------------------------------------------------------------------------
r5938 | simon | 2005-06-10 15:27:26 +0400 (, 10  2005) | 2 lines

Patch from James Harvey to rearrange the Same Game colours.

------------------------------------------------------------------------
r5937 | simon | 2005-06-10 15:24:44 +0400 (, 10  2005) | 6 lines

Patch from Chris Emerson to add a status bar to Rectangles. Apart
from saying `Auto-solved' or `Completed', the main function of the
status bar is to track the current size of a rectangle you're
dragging out, which makes life much easier when trying to count up
large rectangles in 19x19 mode.

------------------------------------------------------------------------
r5936 | simon | 2005-06-09 22:29:11 +0400 (, 09  2005) | 7 lines

GDK 2.6, in its doubtless infinite wisdom, has decided that
gdk_font_from_description() will no longer even _try_ to return a
font matching the specified Pango font description; instead it will
return `fixed' no matter what you do. Therefore, I've had to switch
to using Pango proper for Puzzles text rendering, rather than just
using Pango for font selection.

------------------------------------------------------------------------
r5926 | jacob | 2005-06-08 13:20:35 +0400 (, 08  2005) | 2 lines

Remove debug output.

------------------------------------------------------------------------
r5923 | jacob | 2005-06-08 01:05:29 +0400 (, 08  2005) | 2 lines

Add Windows help topic

------------------------------------------------------------------------
r5922 | jacob | 2005-06-08 01:03:14 +0400 (, 08  2005) | 2 lines

Tweaks and more complete documentation for Same Game.

------------------------------------------------------------------------
r5921 | simon | 2005-06-08 00:44:14 +0400 (, 08  2005) | 2 lines

Integer overflow in game_size(). Oops.

------------------------------------------------------------------------
r5920 | simon | 2005-06-08 00:25:25 +0400 (, 08  2005) | 3 lines

Chris Emerson points out that gtk_window_resize() isn't in GTK 1.2.
Work around it the same way I did in PuTTY.

------------------------------------------------------------------------
r5919 | simon | 2005-06-08 00:22:25 +0400 (, 08  2005) | 2 lines

James Harvey's patch to support keyboard control in Same Game.

------------------------------------------------------------------------
r5918 | simon | 2005-06-08 00:22:08 +0400 (, 08  2005) | 2 lines

Forgot to add Same Game to the big list for OS X.

------------------------------------------------------------------------
r5916 | simon | 2005-06-07 23:07:58 +0400 (, 07  2005) | 3 lines

James Harvey (again) points out an array underrun in the new
clash-checking code in Solo. (valgrind confirms it.)

------------------------------------------------------------------------
r5915 | simon | 2005-06-07 23:04:52 +0400 (, 07  2005) | 8 lines

Another James Harvey patch. This one introduces a new button code
called `CURSOR_SELECT', intended for platforms which have a fire
button to go with their cursor keys. (Apparently some Palms do.)
CURSOR_SELECT is not bound to anything on any of the current three
platforms, and therefore no game may rely on it being available.
This checkin adds it in Net as a synonym for 'a', the keyboard-based
rotate-left command.

------------------------------------------------------------------------
r5914 | simon | 2005-06-07 23:01:36 +0400 (, 07  2005) | 3 lines

James Harvey has contributed an implementation of `Same Game', also
known as ksame (KDE) and Same GNOME (GNOME).

------------------------------------------------------------------------
r5913 | simon | 2005-06-07 21:57:50 +0400 (, 07  2005) | 26 lines

All the games in this collection have always defined their graphics
in terms of a constant TILE_SIZE (or equivalent). Here's a
surprisingly small patch which switches this constant into a
run-time variable.

The only observable behaviour change should be on Windows, which
physically does not permit the creation of windows larger than the
screen; if you try to create a puzzle (Net makes this plausible)
large enough to encounter this restriction, the Windows front end
should automatically re-adjust the puzzle's tile size so that it
does fit within the available space.

On GTK, I haven't done this, on the grounds that X _does_ permit
windows larger than the screen, and many X window managers already
provide the means to navigate around such a window. Gareth said he'd
rather navigate around a huge Net window than have it shrunk to fit
on one screen. I'm uncertain that this makes sense for all puzzles -
Pattern in particular strikes me as something that might be better
off shrunk to fit - so I may have to change policy later or make it
configurable.

On OS X, I also haven't done automatic shrinkage to fit on one
screen, largely because I didn't have the courage to address the
question of multiple monitors and what that means for the entire
concept :-)

------------------------------------------------------------------------
r5912 | simon | 2005-06-06 15:21:36 +0400 (, 06  2005) | 16 lines

Introduce a new game backend function (there seem to have been a lot
of these recently) whose job is to update a game_ui to be consistent
with a new game_state. This is called by midend.c in every situation
where the current game_state changes _other_ than as a result of
make_move (Undo, Redo, Restart, Solve).

The introduction of this function allows a game_ui to contain
information about selections or highlights within a game_state which
simply wouldn't make sense when transferred to another game_state.
In particular, I've used it to fix a subtle bug in Solo whereby,
although you couldn't right-click to pencil-mode highlight a filled
square, you could _get_ a pencil-mode highlight in a filled square
if you used Undo and Redo. (Undo to before the square was filled,
right-click to highlight it, then Redo. Alternatively, left-click
and clear the square, right-click to highlight it, then Undo.)

------------------------------------------------------------------------
r5911 | simon | 2005-06-04 21:51:49 +0400 (, 04  2005) | 5 lines

Small UI bug: LEFT_RELEASEs were being thrown away completely if
their coordinates were outside the playing area. Clearly no actual
move should be made in that situation, but we do at least need to
sort out any highlighted squares from the prior dragging operations.

------------------------------------------------------------------------
r5909 | simon | 2005-06-04 16:32:40 +0400 (, 04  2005) | 9 lines

Revamp pencil mark placement and sizing. Pencil marks are now sized
and positioned according to how many there are in the cell, rather
than how many distinct digits there are in the entire puzzle. This
means that 4x4 Solo can now be played with pencil marks without
_too_ much difficulty; the marks will still get a bit crowded if you
have more than 12 in the same square, but with luck that shouldn't
happen often, and as long as you're down in the 2-9 range things
should be entirely legible.

------------------------------------------------------------------------
r5908 | simon | 2005-06-04 13:59:03 +0400 (, 04  2005) | 6 lines

James Harvey requested that puzzles not use DEBUG as a preprocessor
symbol for enabling diagnostics, presumably because in his Palm port
it means something else as well. He sent this patch to switch Net
and Netslide over to using GENERATION_DIAGNOSTICS, in the fashion of
the newer games.

------------------------------------------------------------------------
r5907 | simon | 2005-06-03 16:27:29 +0400 (, 03  2005) | 9 lines

Colin Watson suggests that Alt-click (or Option-click) could
usefully be equivalent to right-clicking on platforms other than OS
X; in particular, it's useful if you're running Linux on Apple
hardware such as PowerBook which inherently has only one button. So
here's the fix for GTK, and Windows as well (the latter for
completeness and consistency, not because I can actually think of
any reason somebody might be running Windows on one-button
hardware).

------------------------------------------------------------------------
r5906 | simon | 2005-06-03 16:10:32 +0400 (, 03  2005) | 8 lines

Unique solubility in Mines means that you can massively increase the
mine density without (as you would with a conventional random grid
generator) rendering the game completely unplayable. High mine
densities are really good fun, and the point of the presets menu is
to provide people with pre-tested good settings and things they
might not have thought to try for themselves; so here are three
additional presets with high densities.

------------------------------------------------------------------------
r5905 | simon | 2005-06-03 12:38:24 +0400 (, 03  2005) | 2 lines

Add mines and mineobfusc to the ignore property.

------------------------------------------------------------------------
r5903 | simon | 2005-06-02 20:34:37 +0400 (, 02  2005) | 7 lines

Standalone compilation mode which turns mines.c into a little
utility to convert descriptive game IDs containing mine bitmaps
between obfuscated and cleartext. Might be handy for anyone planning
to design custom levels to send to friends (mines spelling out
`Happy Birthday', that sort of thing), as someone suggested to me
today :-)

------------------------------------------------------------------------
r5902 | simon | 2005-06-02 12:14:14 +0400 (, 02  2005) | 4 lines

Fix various departures from C found by `gcc -ansi -pedantic'. I
haven't checked in Makefile changes to enable this, but I'll at
least fix the specific problems it found when enabled as a one-off.

------------------------------------------------------------------------
r5900 | jacob | 2005-06-02 02:56:20 +0400 (, 02  2005) | 4 lines

min()/max() macros conflict with ones defined by Windows (or at least MinGW)
headers; but MIN()/MAX() conflict with glib. Let's keep the lower-case ones,
and assume that any provided by the system have the obvious semantics.

------------------------------------------------------------------------
r5899 | simon | 2005-06-01 22:57:28 +0400 (, 01  2005) | 2 lines

Fix Richard's patch so that it's actually C :-/

------------------------------------------------------------------------
r5898 | simon | 2005-06-01 22:33:25 +0400 (, 01  2005) | 7 lines

Another highlighting patch from Richard Boulton: immediately flag
any actual clashes (duplicate numbers in a row, column or block) in
red. This is a non-privileged deduction: it doesn't compare against
a known solution or consult a solver. It simply indicates reasons
why (no superset of) the current grid would cause the completion
flash to go off.

------------------------------------------------------------------------
r5897 | simon | 2005-06-01 21:47:56 +0400 (, 01  2005) | 17 lines

Miscellaneous fixes from James Harvey's PalmOS porting work:
 - fixed numerous memory leaks (not Palm-specific)
 - corrected a couple of 32-bit-int assumptions (vital for Palm but
   generally a good thing anyway)
 - lifted a few function pointer types into explicit typedefs
   (neutral for me but convenient for the source-munging Perl
   scripts he uses to deal with Palm code segment rules)
 - lifted a few function-level static arrays into global static
   arrays (neutral for me but apparently works round a Palm tools
   bug)
 - a couple more presets in Rectangles (so that Palm, or any other
   slow platform which can't handle the larger sizes easily, can
   still have some variety available)
 - in Solo, arranged a means of sharing scratch space between calls
   to nsolve to prevent a lot of redundant malloc/frees (gives a 10%
   speed increase even on existing platforms)

------------------------------------------------------------------------
r5896 | simon | 2005-06-01 16:46:27 +0400 (, 01  2005) | 3 lines

Arrange that random seeds are as harmonised as they can reasonably
be between interactive and batch use.

------------------------------------------------------------------------
r5895 | simon | 2005-06-01 16:42:30 +0400 (, 01  2005) | 6 lines

I've proved that a grid dimension of 2 is capable of irretrievably
hanging the grid generator and that there's no way to fix it.
Therefore, lower limit of 3 squares in each direction, which will
upset envelope-pushers everywhere but doesn't destroy any actually
interesting puzzles.

------------------------------------------------------------------------
r5893 | simon | 2005-06-01 11:22:21 +0400 (, 01  2005) | 4 lines

Gareth points out that the recess highlights around the outside of
the grid, in all games that have them, are drawn incorrectly when
the grid is not square. Fixed.

------------------------------------------------------------------------
r5892 | simon | 2005-06-01 11:01:32 +0400 (, 01  2005) | 10 lines

Patches from Richard B for Solo:
 - prevent highlighting a clue square at all
 - enable easier switching between highlight types by not requiring
   a left-click highlight to be left-click-cancelled before
   right-clicking, and vice versa
 - fix bit-rot in -DSTANDALONE_SOLVER
Also one of mine:
 - replicate Richard's -DSTANDALONE_SOLVER fix in Pattern, where it
   was also broken.

------------------------------------------------------------------------
r5891 | simon | 2005-06-01 10:54:14 +0400 (, 01  2005) | 4 lines

Chris Emerson observed the same status-bar flicker under GTK as I
did under Windows, so here's his patch (blatantly copied from my own
fix in windows.c :-).

------------------------------------------------------------------------
r5890 | simon | 2005-06-01 10:47:55 +0400 (, 01  2005) | 2 lines

Typo in click bounds checking.

------------------------------------------------------------------------
r5888 | simon | 2005-05-31 22:38:01 +0400 (, 31  2005) | 10 lines

Better mouse button handling in Mines:
 - middle button now also triggers the clear-around-square action
 - a special-case handler in midend_process_key() arranges that the
   left button always trumps the right button if both are pressed
   together, meaning that Windows Minesweeper players used to
   pressing L+R to clear around a square should still be able to do
   so without any strange behaviour.
(The latter touches all game backends, yet again, to add a field to
the game structure which is zero in everything except Mines.)

------------------------------------------------------------------------
r5887 | simon | 2005-05-31 22:25:06 +0400 (, 31  2005) | 2 lines

Bah, and remove the TODO item. As usual.

------------------------------------------------------------------------
r5886 | simon | 2005-05-31 22:24:39 +0400 (, 31  2005) | 14 lines

Now _this_ is what Undo ought to be doing in a Minesweeper clone.
Rather than revealing the entire mine layout when you die, we now
only reveal the one mine that killed you. You can then Undo and
continue playing, without having spoiled the rest of the grid for
yourself. The number of times you've died is counted in the status
line (and is not reduced by Undo :-).

Amusingly, I think this in itself is quite a good way of dealing
with ambiguous sections in a Minesweeper grid: they no longer
_completely_ spoil your enjoyment of the game, because you can still
play the remainder of the grid even if you haven't got a completely
clean sweep. Just my luck that I should invent the idea when I've
already arranged for ambiguous sections to be absent :-)

------------------------------------------------------------------------
r5885 | simon | 2005-05-31 22:09:28 +0400 (, 31  2005) | 9 lines

Aha! It turns out, after a bit of failure-mode profiling, that when
the Mines unique grid generator fails at high mine densities it is
_almost always_ for the same reason, and it also turns out that this
reason is one which can be addressed. So here's an enhancement to
mineperturb() which enables Mines to generate a grid at (as far as I
can tell) any mine density you like, up to and including w*h-9
mines. At densities of 1 in 2 or thereabouts the grids start to look
rather strange, but it can at least generate them without hanging.

------------------------------------------------------------------------
r5884 | simon | 2005-05-31 21:46:22 +0400 (, 31  2005) | 3 lines

valgrind spotted this array underrun. I wonder if this might have
been causing some of Verity's nonreproducible weirdnesses.

------------------------------------------------------------------------
r5883 | simon | 2005-05-31 21:09:39 +0400 (, 31  2005) | 11 lines

Oops! A trivial typo in obfuscate_bitmap() made the obfuscation
function rather less uniform-looking than I'd intended. I _thought_
it looked a bit fishy, but had assumed it was just the human
tendency to see patterns where none exist. Now fixed, and some real
test vectors confirm that this time the obfuscation function is
actually what I intended it to be.

This means that all masked game IDs generated before this revision
are now invalid. That's a shame, but the game is only a day old and
I think I can reasonably justify it as teething trouble.

------------------------------------------------------------------------
r5882 | simon | 2005-05-31 17:02:26 +0400 (, 31  2005) | 2 lines

`Solve' operation is relatively simple in Mines.

------------------------------------------------------------------------
r5880 | simon | 2005-05-31 16:41:18 +0400 (, 31  2005) | 3 lines

Apparently a number of Windows programs like to use ^Y as a keyboard
shortcut for Redo. I wasn't doing anything else with it, so why not?

------------------------------------------------------------------------
r5879 | jacob | 2005-05-31 16:12:47 +0400 (, 31  2005) | 2 lines

Document the mouse control method for Cube.

------------------------------------------------------------------------
r5878 | jacob | 2005-05-31 16:03:25 +0400 (, 31  2005) | 3 lines

Move definition of PI into puzzles.h. If nothing else, the definition in cube.c
had a typo :)

------------------------------------------------------------------------
r5877 | simon | 2005-05-31 15:43:51 +0400 (, 31  2005) | 12 lines

Mouse-based interface for Cube: you left-click anywhere on the grid
and it moves the polyhedron in the general direction of the mouse
pointer. (I had this in my initial throwaway Python implementation
of this game, but never reimplemented it in this version. It's
harder with triangles, but not too much harder.)

Since the logical-to-physical coordinate mapping in Cube is
dynamically computed, this has involved an interface change which
touches all puzzles: make_move() is now passed a pointer to the
game_drawstate, which it may of course completely ignore if it
wishes.

------------------------------------------------------------------------
r5876 | simon | 2005-05-31 15:20:24 +0400 (, 31  2005) | 7 lines

Emma Garside suggested that it would be nice to have a different
background colour for covered and uncovered squares in Mines, since
otherwise you have to distinguish them by the edge highlights alone.
So here one is; it's not _very_ different (it just looked odd if it
was any darker than this), but anyone who wants a bigger difference
can reconfigure it using the MINES_COLOUR_1 environment variable.

------------------------------------------------------------------------
r5875 | simon | 2005-05-31 15:19:11 +0400 (, 31  2005) | 20 lines

Improved the limited shuffle mechanism in Sixteen and Twiddle. They
were already making sure that no shuffle move was the precise
inverse of the previous one, or contributed to repeating the
previous one so many times as to turn it into effectively fewer
moves (doing the same rotation three times in Twiddle, or shifting a
row by more than half its length in Sixteen). However, they were
only checking against the _last_ move, which meant that in any
situation where there were completely disjoint move spaces (4x4n2
Twiddle, or any Sixteen at all) it was still possible to have A then
B then inv(A) occurring in the shuffle, leading to an unnecessarily
easy game.

Now both shuffle routines keep separate track of all
_non-overlapping_ recent moves, and will avoid inverting any move
which hasn't had another move overlap it since it was made. This
should reduce the incidence of too-easy limited shuffle games,
although it can't be prevented _entirely_ (since, if nothing else,
it's always possible to increase the shuffle limit past the maximum
group radius).

------------------------------------------------------------------------
r5873 | simon | 2005-05-31 12:56:33 +0400 (, 31  2005) | 2 lines

Fix a couple of robustness issues.

------------------------------------------------------------------------
r5872 | simon | 2005-05-31 12:50:42 +0400 (, 31  2005) | 6 lines

GTK misfires timers at inconvenient moments, sometimes causing a new
puzzle of a different size to be redrawn before the pixmap is
resized, and since backends never redraw already-drawn stuff this is
a problem. Was biting me when I entered a Mines game ID of a
different size than the current settings into the Specific box.

------------------------------------------------------------------------
r5871 | simon | 2005-05-31 02:33:34 +0400 (, 31  2005) | 2 lines

Chris's patch to stop Mines depending on char being signed.

------------------------------------------------------------------------
r5869 | simon | 2005-05-30 22:41:40 +0400 (, 30  2005) | 6 lines

Added an `interactive' flag to new_game_desc(), which toggles Mines
between on the one hand generating indeterminate game descriptions
awaiting the initial click, and on the other hand generating
concrete ones which have had their initial click. This makes `mines
--generate' do something useful.

------------------------------------------------------------------------
r5868 | simon | 2005-05-30 22:24:06 +0400 (, 30  2005) | 2 lines

`Copy' operation for Mines.

------------------------------------------------------------------------
r5867 | simon | 2005-05-30 21:57:45 +0400 (, 30  2005) | 3 lines

Constrain mine count to be at most the largest number of mines we
can guarantee to fit into the grid!

------------------------------------------------------------------------
r5866 | simon | 2005-05-30 20:15:34 +0400 (, 30  2005) | 12 lines

First cut at a game timer. Yet another backend function which
indicates whether a particular game state should have the timer
going (for Mines the initial indeterminate state does not have this
property, and neither does a dead or won state); a midend function
that optionally (on request from the game) prepends a timer to the
front of the status bar text; some complicated midend timing code.

It's not great. It's ugly; it's probably slightly inaccurate; it's
got no provision for anyone but the game author decreeing whether a
game is timed or not. But Mines can't be taken seriously without a
timer, so it's a start.

------------------------------------------------------------------------
r5863 | simon | 2005-05-30 17:11:05 +0400 (, 30  2005) | 2 lines

D'oh, there's always one. Remove first-click stuff from the todo list.

------------------------------------------------------------------------
r5862 | simon | 2005-05-30 17:10:37 +0400 (, 30  2005) | 30 lines

Mines now follows the conventional approach of offering a completely
blank grid until you make the first click; to ensure solubility, it
does not generate the mine layout until that click, and then ensures
it is solvable starting from that position.

This has involved three infrastructure changes:

 - random.c now offers functions to encode and decode an entire
   random_state as a string
 - each puzzle's new_game() is now passed a pointer to the midend
   itself, which most of them ignore
 - there's a function in the midend which a game can call back to
   _rewrite_ its current game description.

So Mines now has two entirely separate forms of game ID. One
contains the generation-time parameters (n and unique) plus an
encoding of a random_state; the other actually encodes the grid once
it's been generated, and also contains the initial click position.
When called with the latter, new_game() does plausibly normal stuff.
When called with the former, it notes down all the details and waits
until the first square is opened, and _then_ does the grid
generation and updates the game description in the midend. So if,
_after_ your first click, you decide you want to share this
particular puzzle with someone else, you can do that fine.

Also in this checkin, the mine layout is no longer _copied_ between
all the game_states on the undo chain. Instead, it's in a separate
structure and all game_states share a pointer to it - and the
structure is reference-counted to ensure deallocation.

------------------------------------------------------------------------
r5861 | simon | 2005-05-30 16:24:31 +0400 (, 30  2005) | 3 lines

Neat idea from Gareth: if you put a % on the end of the mine count
in the Custom dialog box, it'll treat it as a mine density.

------------------------------------------------------------------------
r5860 | jacob | 2005-05-30 15:49:08 +0400 (, 30  2005) | 2 lines

Nit: "warning: extra tokens at end of #endif directive"

------------------------------------------------------------------------
r5859 | simon | 2005-05-30 14:08:27 +0400 (, 30  2005) | 3 lines

Initial checkin of my Minesweeper clone, which uses a solver during
grid generation to arrange a mine layout that never requires guessing.

------------------------------------------------------------------------
r5858 | simon | 2005-05-30 11:55:27 +0400 (, 30  2005) | 6 lines

Infrastructure change: game_anim_length and game_flash_length now
both get passed a pointer to the game_ui. This means that if they
need to note down information for the redraw function about what
_type_ of flash or animation is required, they now have somewhere to
do so.

------------------------------------------------------------------------
r5854 | jacob | 2005-05-29 03:45:43 +0400 (, 29  2005) | 3 lines

Add a limited-shuffle mode like that added to Sixteen and Twiddle in r5769,
for completeness.

------------------------------------------------------------------------
r5852 | simon | 2005-05-28 12:04:29 +0400 (, 28  2005) | 6 lines

Add the ability to use the Rectangles solver for actually solving
puzzles, rather than just doing its nondeterministic number
placement thing. This enables the use of the `Solve' menu option on
externally entered game IDs, provided of course that they aren't
_too_ difficult.

------------------------------------------------------------------------
r5847 | simon | 2005-05-26 21:12:04 +0400 (, 26  2005) | 2 lines

Add support for Jacob's new cursor-key modifier flags in the OS X frontend.

------------------------------------------------------------------------
r5846 | simon | 2005-05-26 21:03:51 +0400 (, 26  2005) | 16 lines

Sorted out the barriers/corners trouble left by r5844. No wonder
Jacob wasn't able to find a satisfactory fix: the whole area was a
horrid mess. Fortunately, the reason it was a horrid mess was
because the Net drawing routines predated the introduction of clip()
in the frontend interface, and it turns out that clip() makes it
possible to do all this more easily and better. So, a complete
rearchitecting of barrier corners: the corner flags in the
`barriers' array are now gone (and good riddance), and corner
information is computed on the fly so as to take into account the
moving grid edges. In the process I've also updated the corner
mechanism so that a barrier `corner' (really endpoint) is drawn at
the end of _every_ barrier, not just where two meet. This has
changed the appearance of a single isolated barrier, to what I would
have wanted it to look like in the first place but achieving it
without clip() was just too fiddly.

------------------------------------------------------------------------
r5845 | jacob | 2005-05-26 20:57:19 +0400 (, 26  2005) | 3 lines

Since the split into random and descriptive IDs, the section on game seeds has
been mostly covered by the main documentation or otherwise moot.

------------------------------------------------------------------------
r5844 | jacob | 2005-05-26 17:40:38 +0400 (, 26  2005) | 9 lines

Add origin-shifting (Shift+cursors) and source-shifting (Ctrl+cursors) to Net.
(Adding modifier+cursors handling has had minor knock-on effects on the other
puzzles, so that they can continue to ignore modifiers.)

(An unfortunate side effect of this is some artifacts in exterior barrier
drawing; notably, a disconnected corner can now appear at the corner of the
grid under some circumstances. I haven't found a satisfactory way round
this yet.)

------------------------------------------------------------------------
r5842 | simon | 2005-05-25 15:09:43 +0400 (, 25  2005) | 4 lines

Support for `pencil marks' in Solo, by right-clicking and typing a
number. Many thanks to Chris Thomas, for helping with the detailed
UI design by means of testing an endless series of prototypes.

------------------------------------------------------------------------
r5841 | jacob | 2005-05-25 00:28:38 +0400 (, 25  2005) | 2 lines

Mention NetWalk and update comment

------------------------------------------------------------------------
r5838 | simon | 2005-05-23 16:02:37 +0400 (, 23  2005) | 4 lines

Avoid leading zeroes on internally generated random seeds, _just_ in
case they confuse anyone who expects the same seed without the
leading zero to be equivalent.

------------------------------------------------------------------------
r5837 | simon | 2005-05-23 15:15:39 +0400 (, 23  2005) | 4 lines

I'm sick of `--generate' giving the same answers if you run it twice
in one second. Switched the Unix get_random_seed() to using
gettimeofday() rather than time().

------------------------------------------------------------------------
r5836 | simon | 2005-05-23 15:13:39 +0400 (, 23  2005) | 3 lines

The GTK `--generate' option didn't validate the game parameters. It
does now.

------------------------------------------------------------------------
r5835 | simon | 2005-05-23 15:03:52 +0400 (, 23  2005) | 8 lines

Net hangs if you ask it for a 2xn or nx2 wrapping puzzle with a
unique solution. This, it turns out, is because there is literally
no such thing. Protective constraint added to validate_params(),
with a proof in a comment alongside.

If you really want a 2xn or nx2 wrapping puzzle, you can still have
one if you turn uniqueness off.

------------------------------------------------------------------------
r5833 | simon | 2005-05-22 17:35:13 +0400 (, 22  2005) | 2 lines

Aesthetic improvements, mostly suggested by Gareth.

------------------------------------------------------------------------
r5830 | simon | 2005-05-22 16:45:39 +0400 (, 22  2005) | 2 lines

Forgot to add print.py to the source archive. Ahem.

------------------------------------------------------------------------
r5829 | simon | 2005-05-22 16:14:39 +0400 (, 22  2005) | 5 lines

Another tweak to the solver to make it handle blank tiles correctly.
The previous checkin stopped it choking on them, but it didn't
actually manage to _deduce_ that all the edges bordering them had to
be closed. Now it does better.

------------------------------------------------------------------------
r5828 | simon | 2005-05-22 15:45:20 +0400 (, 22  2005) | 9 lines

Special case in dead-end checking which prevents the solver falling
over on a grid containing a 0 (completely blank) tile. This can't
happen in self-generated grids, but can happen if you type in a grid
from another Net implementation. Previously, the solver would notice
(technically correctly!) that a completely blank tile connects to no
other tiles and thus forms an isolated subgraph, and would therefore
complain that no orientation of that tile could possibly yield a
valid solution...

------------------------------------------------------------------------
r5827 | simon | 2005-05-22 15:15:03 +0400 (, 22  2005) | 3 lines

The Net solver now makes use of barrier information when applied to
a typed-in grid.

------------------------------------------------------------------------
r5826 | simon | 2005-05-22 15:06:25 +0400 (, 22  2005) | 3 lines

It occurred to me yesterday that Net could perfectly well be played
on paper, so here's a routine to print it out.

------------------------------------------------------------------------
r5825 | jacob | 2005-05-22 02:07:48 +0400 (, 22  2005) | 4 lines

Ensure that an old random seed isn't left around for the user to see when a
descriptive ID has been specified.
Fix tiny memory leak.

------------------------------------------------------------------------
r5818 | simon | 2005-05-21 17:39:23 +0400 (, 21  2005) | 6 lines

Cleanups:
 - fix documentation of Net's unique solution option (should have
   tested before last checkin)
 - make unique solutions optional in Rectangles too (same reasons)
 - tidy up various issues in parameter encoding in both games.

------------------------------------------------------------------------
r5816 | simon | 2005-05-21 17:23:26 +0400 (, 21  2005) | 5 lines

Solution uniqueness for Net. Can be disabled on request (but is
enabled by default), since ambiguous sections in grids can present
additional interesting challenges. I think uniqueness is a better
default, though.

------------------------------------------------------------------------
r5814 | simon | 2005-05-20 16:30:37 +0400 (, 20  2005) | 2 lines

Move IDM_ABOUT so that it doesn't overlap the presets space! Ahem.

------------------------------------------------------------------------
r5809 | simon | 2005-05-19 20:17:03 +0400 (, 19  2005) | 14 lines

Cunning way to ensure unique solutions in generated Rectangles
puzzles. I generate the grid of rectangles as normal, but before I
place the numbers I run it through a non-deterministic solver
algorithm which tries to do as much as it can with as little
information about where the numbers are going to be. The solver
itself narrows down the number placement when it runs out of steam,
but does so as little as possible. Once it reaches a state where it
has ensured solubility, and then the generation algorithm chooses
random number placement from whatever's left.

Occasionally it paints itself into a corner and can't ensure a
unique solution no matter what happens; in that situation we just
have to give up, generate a fresh grid, and try again.

------------------------------------------------------------------------
r5808 | simon | 2005-05-18 21:41:53 +0400 (, 18  2005) | 7 lines

If you paste in a random seed with different ephemeral parameters
from the currently configured ones, and then bring the Random Seed
box back up, the wrong parameters get shown, and the resulting
random seed is incorrect for the current game.

At least, it was, until this checkin.

------------------------------------------------------------------------
r5807 | simon | 2005-05-18 21:28:48 +0400 (, 18  2005) | 3 lines

Rectangles random seed IDs shouldn't bother stating the expansion
factor if it's zero.

------------------------------------------------------------------------
r5806 | simon | 2005-05-18 21:27:16 +0400 (, 18  2005) | 2 lines

--version.

------------------------------------------------------------------------
r5805 | simon | 2005-05-18 21:25:30 +0400 (, 18  2005) | 2 lines

It's a good idea to validate presets received from the environment.

------------------------------------------------------------------------
r5801 | simon | 2005-05-18 13:04:47 +0400 (, 18  2005) | 7 lines

Move the colour configuration into midend.c so that it becomes
cross-platform, and rename the environment variables so that they
follow the puzzle name. Should allow a static environment
configuration for each puzzle. Also introduced a <game>_PRESETS
variable for people whose favourite configuration isn't on the Type
menu by default.

------------------------------------------------------------------------
r5800 | simon | 2005-05-18 12:34:01 +0400 (, 18  2005) | 2 lines

Standalone solvers were broken by my recent API changes.

------------------------------------------------------------------------
r5799 | jacob | 2005-05-17 22:04:12 +0400 (, 17  2005) | 2 lines

Update doc for recent changes in Restart behaviour.

------------------------------------------------------------------------
r5796 | simon | 2005-05-17 21:20:08 +0400 (, 17  2005) | 5 lines

After much thought, I've decided that `Restart' on r is not a
particularly useful keypress, particularly given how easy it is to
confuse it with `Redo'. So both r and ^R are now Redo, and Restart
is relegated to being a menu-only option.

------------------------------------------------------------------------
r5794 | jacob | 2005-05-17 16:02:30 +0400 (, 17  2005) | 2 lines

Null-terminate generated Net/Netslide descriptive game IDs.

------------------------------------------------------------------------
r5793 | simon | 2005-05-17 15:53:42 +0400 (, 17  2005) | 5 lines

Keyboard shortcuts for Twiddle: abcdABCD in line with the notation
Gareth and I have been using to analyse the game, and also the
number pad. They don't work sensibly for all sizes, but they'll be
handy for the most common ones.

------------------------------------------------------------------------
r5792 | simon | 2005-05-17 15:47:33 +0400 (, 17  2005) | 4 lines

Just for Gareth: a means of overriding individual game colour
settings using environment variables. GTK frontend only, because
this is an unsupported (and unprincipled) hack.

------------------------------------------------------------------------
r5791 | simon | 2005-05-17 15:46:55 +0400 (, 17  2005) | 17 lines

`Restart' is now an undo-able action: it appends a move to the end
of the undo list rather than destroying it. Partly this is because
accidental restarts are a real pain, and partly because it allows
you to compare the initial to the current state by restart-then-undo
which is handy in some puzzles.

In order to do this, I've introduced an additional per-entry field
in the undo list in the midend, which tracks which states were
created by `unusual' operations (Solve and Restart). The midend
takes care of suppressing animation and completion flashes during
transitions between a `special' state and its predecessor, relieving
the game backends of having to do it individually.

(This probably means I could remove some complexity in the
flash_time() functions in most backends, but I haven't done that in
this checkin.)

------------------------------------------------------------------------
r5790 | jacob | 2005-05-17 15:00:15 +0400 (, 17  2005) | 2 lines

comment c'n'p error

------------------------------------------------------------------------
r5789 | simon | 2005-05-17 14:59:47 +0400 (, 17  2005) | 2 lines

Cube's dup_game() function was missing a field. Oops.

------------------------------------------------------------------------
r5788 | simon | 2005-05-16 22:57:09 +0400 (, 16  2005) | 31 lines

The game IDs for Net (and Netslide) have always been random seeds
rather than literal grid descriptions, which has always faintly
annoyed me because it makes it impossible to type in a grid from
another source. However, Gareth pointed out that short random-seed
game descriptions are useful, because you can read one out to
someone else without having to master the technology of cross-
machine cut and paste, or you can have two people enter the same
random seed simultaneously in order to race against each other to
complete the same puzzle. So both types of game ID seem to have
their uses.

Therefore, here's a reorganisation of the whole game ID concept.
There are now two types of game ID: one has a parameter string then
a hash then a piece of arbitrary random seed text, and the other has
a parameter string then a colon then a literal game description. For
most games, the latter is identical to the game IDs that were
previously valid; for Net and Netslide, old game IDs must be
translated into new ones by turning the colon into a hash, and
there's a new descriptive game ID format.

Random seed IDs are not guaranteed to be portable between software
versions (this is a major reason why I added version reporting
yesterday). Descriptive game IDs have a longer lifespan.

As an added bonus, I've removed the sections of documentation
dealing with game parameter encodings not shown in the game ID
(Rectangles expansion factor, Solo symmetry and difficulty settings
etc), because _all_ parameters must be specified in a random seed ID
and therefore users can easily find out the appropriate parameter
string for any settings they have configured.

------------------------------------------------------------------------
r5784 | simon | 2005-05-15 15:12:05 +0400 (, 15  2005) | 2 lines

Missed a vital semicolon off the Cygwin version.c makefile fragment.

------------------------------------------------------------------------
r5783 | simon | 2005-05-15 14:58:09 +0400 (, 15  2005) | 3 lines

Er, except that I already had a makedist.sh. Transferred new version
code into that!

------------------------------------------------------------------------
r5782 | simon | 2005-05-15 14:52:23 +0400 (, 15  2005) | 4 lines

Added automatic determination of the SVN revision number if a build
takes place in a checked-out copy. Also added mkunxarc.sh which does
the same version determination before building its archive.

------------------------------------------------------------------------
r5781 | simon | 2005-05-15 14:31:11 +0400 (, 15  2005) | 6 lines

Introduce a versioning mechanism, and an `About' box in all front
ends. Versioning will be done solely by Subversion revision number,
since development on these puzzles is very incremental and gradual
and there don't tend to be obvious points to place numbered
releases.

------------------------------------------------------------------------
r5774 | simon | 2005-05-12 22:25:57 +0400 (, 12  2005) | 13 lines

I've had two complaints that Solo ought to recognise the numeric
keypad. The reason it doesn't is because front ends were carefully
translating the numeric keypad into 8-way directional keys for the
benefit of Cube. Therefore, a policy change:
 - front ends process the numeric keypad by sending MOD_NUM_KEYPAD |
   '3' and similar
 - front ends running on a platform with Num Lock SHOULD do this
   _irrespective_ of the state of Num Lock
 - back ends do whatever they see fit with numeric keypad keys.
Result: the numeric keypad now works in Solo, and also works in OS X
Cube (which it previously didn't because I forgot to implement that
bit of the front end!).

------------------------------------------------------------------------
r5769 | simon | 2005-05-12 00:38:10 +0400 (, 12  2005) | 10 lines

The two Rubik-like puzzles, Sixteen and Twiddle, now support an
additional configuration parameter, which is the number of shuffle
moves. By default the grid will be fully shuffled so that you need a
general solution algorithm to untangle it, but if you prefer you can
request a grid which has had (say) precisely four moves made on it,
and then attempt to exactly reverse those four moves.

Currently this feature is only available from the Custom box, and
not in any presets.

------------------------------------------------------------------------
r5767 | simon | 2005-05-11 22:49:42 +0400 (, 11  2005) | 2 lines

Bah. Try the r5766 fix again, this time without the typo.

------------------------------------------------------------------------
r5766 | simon | 2005-05-11 17:03:17 +0400 (, 11  2005) | 4 lines

Completion flashes were occasionally failing to be cleaned up if a
subsequent move animation began during them. Tracked this to
overenthusiastic use of clip() and fixed it.

------------------------------------------------------------------------
r5759 | simon | 2005-05-07 20:07:26 +0400 (, 07  2005) | 11 lines

solve_game() is passed the _initial_ game state, not the most recent
one; so we can't just set `ret->completed = ret->movecount' and hope
it's been set to something other than zero. Instead, we set both
move counts to 1, which is entirely arbitrary but works.

This fixes a subtle bug with the Solve feature: if you pressed
Solve, then disturbed the grid, then brought it back to the solved
state by making more forward moves (rather than using Undo), then
the first time you did this the `Moves since auto-solve' status line
would reset to zero.

------------------------------------------------------------------------
r5757 | simon | 2005-05-07 16:35:04 +0400 (, 07  2005) | 2 lines

Add 3x3 Trivial to the presets list, and make it the default.

------------------------------------------------------------------------
r5756 | simon | 2005-05-07 16:30:29 +0400 (, 07  2005) | 7 lines

Aha, here's a nice easy way to generate really hard puzzles. Added
the missing fifth difficulty level to Solo: `Unreasonable', in which
even set-based reasoning is insufficient and there's no alternative
but to guess a number and backtrack if it didn't work. (Solutions
are still guaranteed unique, however.) In fact it now seems to take
less time to generate a puzzle of this grade than `Advanced'!

------------------------------------------------------------------------
r5744 | jacob | 2005-05-04 17:17:45 +0400 (, 04  2005) | 2 lines

Fix outdated comment

------------------------------------------------------------------------
r5743 | jacob | 2005-05-04 16:56:04 +0400 (, 04  2005) | 2 lines

Allow for trailing '\0' in game_text_format() in various games.

------------------------------------------------------------------------
r5742 | simon | 2005-05-04 16:52:51 +0400 (, 04  2005) | 10 lines

The Twiddle shuffling algorithm was theoretically parity-unbalanced:
it performed a fixed number of shuffling moves, and on each one it
had a 2/3 chance of flipping the permutation parity and a 1/3 chance
of keeping it the same. Markov analysis shows that over a run of
1500-odd shuffle moves this will end up being an undetectably small
actual bias in the parity of the generated grid, but it offends my
sense of pedantry nonetheless so here's a small change to make the
number of shuffling moves itself have randomly chosen parity. The
parity of generated grids should now be _exactly_ 50:50.

------------------------------------------------------------------------
r5739 | jacob | 2005-05-04 16:24:16 +0400 (, 04  2005) | 2 lines

markup typo

------------------------------------------------------------------------
r5737 | simon | 2005-05-02 20:59:50 +0400 (, 02  2005) | 5 lines

I've changed my mind. For the benefit of users with slower
computers, let's save the Solo and Pattern grids at generation time
and regurgitate them when asked to solve, rather than doing all the
work over again.

------------------------------------------------------------------------
r5736 | simon | 2005-05-02 20:37:20 +0400 (, 02  2005) | 2 lines

Fix line endings when pasting on Windows.

------------------------------------------------------------------------
r5735 | simon | 2005-05-02 17:41:34 +0400 (, 02  2005) | 2 lines

Add more useful ignores.

------------------------------------------------------------------------
r5734 | simon | 2005-05-02 17:27:59 +0400 (, 02  2005) | 2 lines

Forgot to mention that you can undo a Solve operation.

------------------------------------------------------------------------
r5733 | simon | 2005-05-02 17:22:25 +0400 (, 02  2005) | 3 lines

Ahem. The `Solve' option in orientable Twiddle needs to correct the
orientations as well as the order!

------------------------------------------------------------------------
r5732 | simon | 2005-05-02 17:18:24 +0400 (, 02  2005) | 2 lines

Silly (but harmless) typo.

------------------------------------------------------------------------
r5731 | simon | 2005-05-02 17:17:10 +0400 (, 02  2005) | 13 lines

Added an automatic `Solve' feature to most games. This is useful for
various things:
 - if you haven't fully understood what a game is about, it gives
   you an immediate example of a puzzle plus its solution so you can
   understand it
 - in some games it's useful to compare your solution with the real
   one and see where you made a mistake
 - in the rearrangement games (Fifteen, Sixteen, Twiddle) it's handy
   to be able to get your hands on a pristine grid quickly so you
   can practise or experiment with manoeuvres on it
 - it provides a good way of debugging the games if you think you've
   encountered an unsolvable grid!

------------------------------------------------------------------------
r5730 | simon | 2005-05-02 14:55:32 +0400 (, 02  2005) | 2 lines

Oops; forgot to check in the copy-to-clipboard option for Windows.

------------------------------------------------------------------------
r5729 | simon | 2005-05-02 14:12:26 +0400 (, 02  2005) | 7 lines

Introduce the concept of a `game_aux_info' structure. This is
constructed at the same time as an internally generated game seed,
so that it can preserve any interesting information known by the
program at generation time but not physically contained within the
text of the game seed itself. (Such as, for example, the solution.)
Currently not used for anything yet, but it will be.

------------------------------------------------------------------------
r5728 | simon | 2005-05-02 13:42:09 +0400 (, 02  2005) | 6 lines

It's actually vitally important, it turns out, to have all of the
`Cut', `Copy' and `Paste' items in the Edit menu of an OS X
application - because there's nothing else that enables the keyboard
cut/copy/paste shortcuts in an edit box! OS X Puzzles can now have
game IDs pasted into it, which it previously couldn't.

------------------------------------------------------------------------
r5727 | simon | 2005-05-01 18:05:03 +0400 (, 01  2005) | 4 lines

The addition of a `Copy' menu item on OS X was really beginning to
strain my unconventional menu organisation, so I've reverted to
having `File' and `Edit' menus like everyone else.

------------------------------------------------------------------------
r5726 | simon | 2005-05-01 17:51:46 +0400 (, 01  2005) | 2 lines

Copy-to-clipboard for Rectangles.

------------------------------------------------------------------------
r5725 | simon | 2005-05-01 17:22:44 +0400 (, 01  2005) | 2 lines

Copy-to-clipboard facility for Fifteen, Sixteen and Twiddle.

------------------------------------------------------------------------
r5724 | simon | 2005-05-01 16:53:41 +0400 (, 01  2005) | 5 lines

Introduced a new function in every game which formats a game_state
as text. This is used by front ends to implement copy-to-clipboard.
Currently the function does nothing (and is disabled) in every game
except Solo, but it's a start.

------------------------------------------------------------------------
r5723 | simon | 2005-05-01 15:07:13 +0400 (, 01  2005) | 6 lines

I can never remember what that `TRUE' means in the game structure
definitions, so let's move it so that it's just next to the
functions it relates to. This also opens the way for me to add more
booleans next to other functions without getting confused as to
which is which.

------------------------------------------------------------------------
r5722 | simon | 2005-05-01 14:57:47 +0400 (, 01  2005) | 2 lines

Remove outdated comment :-)

------------------------------------------------------------------------
r5721 | simon | 2005-05-01 14:57:23 +0400 (, 01  2005) | 2 lines

I think Windows fonts look better in bold as well.

------------------------------------------------------------------------
r5718 | simon | 2005-04-30 18:50:33 +0400 (, 30  2005) | 5 lines

Fix game IDs, which I broke in the orientability change. Also
introduce a sensible game ID notation for orientable games, and
finally (*blush*) turn the orientability triangles back the right
way up.

------------------------------------------------------------------------
r5717 | simon | 2005-04-30 18:38:20 +0400 (, 30  2005) | 4 lines

After brainstorming with Gareth, we've decided that this is a much
simpler and better way to indicate tile orientation than those
colour bars.

------------------------------------------------------------------------
r5714 | simon | 2005-04-30 18:14:37 +0400 (, 30  2005) | 2 lines

Bah, and of course there's a TODO comment I forgot to remove.

------------------------------------------------------------------------
r5713 | simon | 2005-04-30 18:14:14 +0400 (, 30  2005) | 4 lines

Twiddle now has an additional mode in which tile orientation
matters. This mode is hard enough to scare the wossnames out of me,
but that's no reason not to put it in anyway!

------------------------------------------------------------------------
r5711 | simon | 2005-04-30 17:20:35 +0400 (, 30  2005) | 2 lines

Add an ignore property.

------------------------------------------------------------------------
r5709 | simon | 2005-04-30 17:11:22 +0400 (, 30  2005) | 3 lines

Pango-derived fonts seem to generally look better if I ask for them
in bold.

------------------------------------------------------------------------
r5708 | simon | 2005-04-30 16:54:22 +0400 (, 30  2005) | 3 lines

New puzzle: `twiddle', generalised from a random door-unlocking
gadget in Metroid Prime 2.

------------------------------------------------------------------------
r5707 | simon | 2005-04-29 21:07:19 +0400 (, 29  2005) | 6 lines

Added a `--generate' command-line option in the GTK port of every
puzzle, to make it construcct puzzle IDs and output them on stdout.
Also checked in print.py, a script which reads puzzle IDs on stdin
and produces PostScript output. With these, you can generate pages
of Pattern, Rectangles and Solo puzzles to take on trains with you.

------------------------------------------------------------------------
r5706 | simon | 2005-04-29 12:11:01 +0400 (, 29  2005) | 3 lines

Correct block coordinate display when standalone solver shows its
working.

------------------------------------------------------------------------
r5705 | simon | 2005-04-28 16:50:56 +0400 (, 28  2005) | 3 lines

Aha, even better: a Makefile hack that causes auto-detection of GTK
2 and fallback to GTK 1.2.

------------------------------------------------------------------------
r5694 | simon | 2005-04-27 23:44:34 +0400 (, 27  2005) | 4 lines

Fix inconsistent vertical centring of text in GTK (and update Solo's
todo list, which complained about this because Solo was the only
puzzle noticeably affected).

------------------------------------------------------------------------
r5693 | simon | 2005-04-27 23:39:20 +0400 (, 27  2005) | 12 lines

Patches for GTK 2. Puzzles already _built_ under GTK 2, but now it
builds better:
 - the GTK makefile now defines $(GTK_CONFIG) which you can
   override, so you can build for GTK 2 with no makefile-editing
   simply by running `make GTK_CONFIG="pkg_config gtk+-2.0"'
 - we use Pango to find appropriate fonts, which means the text in
   the puzzles actually (gasp!) adapts its size to the
   circumstances. Unfortunately, I've been unable to do this
   portably without depending on _either_ a Pango function that
   isn't present in older versions _or_ the underlying window system
   being X11; I'd appreciate someone doing better.

------------------------------------------------------------------------
r5691 | simon | 2005-04-27 20:59:18 +0400 (, 27  2005) | 3 lines

Command-line solver was dividing up non-square puzzles the wrong way
round.

------------------------------------------------------------------------
r5686 | simon | 2005-04-27 15:13:33 +0400 (, 27  2005) | 3 lines

Pattern also contains an internal solver, so here's a command-line
interface to it just in case it comes in handy.

------------------------------------------------------------------------
r5683 | simon | 2005-04-26 21:03:56 +0400 (, 26  2005) | 3 lines

The command-line solver's difficulty gradings now use the same
terminology as the puzzle GUI.

------------------------------------------------------------------------
r5682 | simon | 2005-04-26 15:19:00 +0400 (, 26  2005) | 9 lines

Implement the remaining modes of reasoning in nsolve, and thus
enable configurable puzzle difficulty. I'm only generating grids up
to Times level (complicated non-recursive analysis but guessing
never required); I wouldn't object to providing a Telegraph
difficulty level (guessing required) but it turns out to be very
hard indeed to generate at random. I might still add it later
(probably under the name `Unreasonable' :-) if I can think of an
efficient way to find them.

------------------------------------------------------------------------
r5681 | simon | 2005-04-26 12:20:25 +0400 (, 26  2005) | 4 lines

Fix trivial UI glitch involving clicking on the border outside the
grid. I'm really starting to get annoyed by the default round-
towards-zero behaviour of C integer division.

------------------------------------------------------------------------
r5672 | simon | 2005-04-25 18:37:33 +0400 (, 25  2005) | 4 lines

Remove some legacy debugging code which was breaking the MinGW
build, and which is redundant given the new standalone solver
functionality.

------------------------------------------------------------------------
r5671 | simon | 2005-04-25 18:17:14 +0400 (, 25  2005) | 3 lines

Oops; _actually_ add the reasoning mode I mentioned in the last
checkin.

------------------------------------------------------------------------
r5670 | simon | 2005-04-25 18:03:53 +0400 (, 25  2005) | 10 lines

Various changes prompted by my boss taking an interest:
 - added a compilation option -DSTANDALONE_SOLVER which makes both
   of Solo's internal solvers accessible from the command line.
 - fix a bug in nsolve turned up by testing in this mode: it failed
   to iterate at all! Oddly, this massive improvement to the
   effectiveness of nsolve hasn't emptied the generated grids by
   very much.
 - add an extra mode of reasoning to my to-do list (which is the
   dual of one already there, so I'm kicking myself).

------------------------------------------------------------------------
r5667 | simon | 2005-04-24 14:06:47 +0400 (, 24  2005) | 3 lines

Outstandingly cute mathematical transformation which allows me to
lose a lot of code duplication in nsolve while preserving efficiency.

------------------------------------------------------------------------
r5666 | simon | 2005-04-24 13:21:57 +0400 (, 24  2005) | 5 lines

Introduce configurable symmetry type in generated puzzles, and drop
the default symmetry from order-4 down to order-2, which seems to
mitigate the excessively-full-grid problem by permitting more
freedom to remove stuff.

------------------------------------------------------------------------
r5665 | jacob | 2005-04-23 22:16:54 +0400 (, 23  2005) | 2 lines

Doc tweaks for Solo.

------------------------------------------------------------------------
r5662 | simon | 2005-04-23 21:09:19 +0400 (, 23  2005) | 13 lines

Simplify clip region handling under Windows, which also makes Solo's
clipping policy work properly. I haven't proved why it didn't work
the previous way, but I have a good guess: I think that clip regions
are handled by reference. So I saved the old clip region out of the
DC, then did an IntersectClipRect, and then selected the old clip
region back in again - but the old clip region had never been
_de_-selected, because IntersectClipRect didn't change which object
was selected but rather it modified-in-place the one that already
was selected. So my attempt to restore the old clip region did
nothing whatsoever, and thus clipping to two different rectangles
during the same draw sequence failed. Now I'm completely destroying
the clip region during unclip(), which seems to work better.

------------------------------------------------------------------------
r5661 | simon | 2005-04-23 20:41:35 +0400 (, 23  2005) | 2 lines

Visual C points out a couple of typos.

------------------------------------------------------------------------
r5660 | simon | 2005-04-23 20:35:28 +0400 (, 23  2005) | 3 lines

Initial checkin of `Solo', the number-placing puzzle popularised by
the Times under the name `Sudoku'.

------------------------------------------------------------------------
r5507 | simon | 2005-03-15 17:24:45 +0300 (, 15  2005) | 3 lines

Oops. Just noticed that the Windows front end completely ignores the
`colour' parameter in draw_text().

------------------------------------------------------------------------
r5391 | simon | 2005-02-24 12:13:06 +0300 (, 24  2005) | 4 lines

Stop the Pattern grid generation from generating an entire row or
column of the same colour (at least when the dimensions are big
enough to make this feasible). It's a little bit too easy otherwise!

------------------------------------------------------------------------
r5390 | simon | 2005-02-24 11:13:32 +0300 (, 24  2005) | 3 lines

Fixes in grid generation for pedantic special cases when one or both
grid dimensions are very small.

------------------------------------------------------------------------
r5258 | simon | 2005-02-05 19:43:13 +0300 (, 05  2005) | 4 lines

I've found NSView's setNeedsDisplayInRect: method, which is
obviously better than just calling setNeedsDisplay on the whole
thing...

------------------------------------------------------------------------
r5210 | simon | 2005-01-26 00:19:28 +0300 (, 26  2005) | 5 lines

Need to impose a _maximum_ width on edit boxes, as well as a minimum
width; if allowed to resize to the text within them, they look
terribly silly when containing an entire Rectangles or Pattern game
ID.

------------------------------------------------------------------------
r5209 | simon | 2005-01-25 21:07:08 +0300 (, 25  2005) | 3 lines

Sanitising the mouse input data was a good idea, but my
implementation sucked. Revise it completely.

------------------------------------------------------------------------
r5208 | simon | 2005-01-25 17:07:46 +0300 (, 25  2005) | 8 lines

Include code in midend.c to sanitise streams of mouse events so that
back ends can be assured of always receiving them in a sensible
sequence (button-down, followed by zero or more drags, followed by
button-up, and never changing button in the middle of such a
sequence). I have a suspicion this issue was the cause of the
mysterious Pattern grid updates seen by Dan during testing last
night.

------------------------------------------------------------------------
r5205 | simon | 2005-01-25 12:07:54 +0300 (, 25  2005) | 6 lines

Ahem. Lots of stuff, including the new OS X sources, was being left
out of the tarball by makedist.sh, causing the downloaded source
tree to fail mkfiles.pl. Worse still, the GTK Makefile wasn't
included, so people _needed_ to run mkfiles.pl! Both now fixed, I
think.

------------------------------------------------------------------------
r5201 | simon | 2005-01-24 18:45:37 +0300 (, 24  2005) | 2 lines

Updates for OS X port (including updating copyright statements).

------------------------------------------------------------------------
r5199 | simon | 2005-01-24 17:10:16 +0300 (, 24  2005) | 3 lines

Ahem. Rogue copy and paste was causing preset menu items to go into
the Help menu rather than the Type menu. Fixed.

------------------------------------------------------------------------
r5197 | simon | 2005-01-24 16:44:24 +0300 (, 24  2005) | 3 lines

`make release' target, which builds a .dmg disk image in what
appears to be the approved Apple fashion.

------------------------------------------------------------------------
r5195 | simon | 2005-01-24 16:04:37 +0300 (, 24  2005) | 2 lines

Help should have the shortcut Command-?.

------------------------------------------------------------------------
r5194 | simon | 2005-01-24 16:00:11 +0300 (, 24  2005) | 4 lines

Improve OS X help: split back up into multiple files (thanks to
Halibut's new \cfg{html-local-head} directive), and add some CSS to
mimic the font choices of system help files.

------------------------------------------------------------------------
r5191 | simon | 2005-01-24 15:09:51 +0300 (, 24  2005) | 7 lines

The #definition of COMBINED was done very badly: it was a piece of
platform-dependent code in puzzles.h (ick), which in turn depended
on the magic symbol MAC_OS_X being defined by mkfiles.pl itself
(yuck). Suddenly realised I can do much better simply by putting it
in an OS X makefile extras section in Recipe, and removing both
previous hacks. Much nicer.

------------------------------------------------------------------------
r5190 | simon | 2005-01-24 15:05:21 +0300 (, 24  2005) | 6 lines

First cut at online help under OS X. I just built the HTML version
of the manual using Halibut (with one additional magic tag in the
<HEAD> section), stuck it in the right part of the application
bundle, referenced it in Info.plist, and added a Help menu.
Everything else was automatic. Not bad!

------------------------------------------------------------------------
r5187 | simon | 2005-01-24 13:50:17 +0300 (, 24  2005) | 6 lines

The main grid outline in Pattern was asymmetric between the top/left
edges and the bottom/right ones. Fix it. (Also remove it from the
todo list in osx.m, where I had entered it in the assumption that it
was a bug in my new OS X port! Turns out it's an entirely platform-
independent bug.)

------------------------------------------------------------------------
r5186 | simon | 2005-01-24 13:45:23 +0300 (, 24  2005) | 2 lines

Fix two window-resizing bugs introduced by the addition of the status bar.

------------------------------------------------------------------------
r5185 | simon | 2005-01-24 13:35:54 +0300 (, 24  2005) | 2 lines

Improve fatal error handling.

------------------------------------------------------------------------
r5184 | simon | 2005-01-24 10:42:01 +0300 (, 24  2005) | 3 lines

Added a dock menu which makes it more convenient to launch a new
game window.

------------------------------------------------------------------------
r5183 | simon | 2005-01-24 10:37:50 +0300 (, 24  2005) | 2 lines

Status bar support.

------------------------------------------------------------------------
r5182 | simon | 2005-01-24 01:28:18 +0300 (, 24  2005) | 4 lines

Implemented the configurable dialog box mechanism, allowing custom
game sizes and entering of specific game IDs. I think this is now a
plausibly usable port, even if still by no means _finished_.

------------------------------------------------------------------------
r5179 | simon | 2005-01-23 14:20:31 +0300 (, 23  2005) | 7 lines

Added a framework for putting things other than the binary into a
Mac OS X application bundle, and provided an icon for Puzzles.

Also renamed the OS X source file from macosx.m to osx.m, so that it
can sit beside other things such as osx-info.plist and not cause
enormously long filenames.

------------------------------------------------------------------------
r5178 | simon | 2005-01-23 12:59:45 +0300 (, 23  2005) | 5 lines

Ah, no, _that_ fixes the malloc problem. I'd forgotten that midend.c
already takes care of managing the allocation of game presets, so
there's no need for me to introduce scary ObjC machinery to do so in
the frontend.

------------------------------------------------------------------------
r5177 | simon | 2005-01-23 12:37:16 +0300 (, 23  2005) | 3 lines

I _think_ this has just fixed an uninitialised-memory bug, but I'm
not sure.

------------------------------------------------------------------------
r5176 | simon | 2005-01-23 12:17:46 +0300 (, 23  2005) | 2 lines

Dynamically frob the menu bar to achieve selection of game presets.

------------------------------------------------------------------------
r5175 | simon | 2005-01-23 11:36:24 +0300 (, 23  2005) | 2 lines

Flesh out the menus a bit.

------------------------------------------------------------------------
r5174 | simon | 2005-01-22 21:46:51 +0300 (, 22  2005) | 2 lines

Update TODO.

------------------------------------------------------------------------
r5173 | simon | 2005-01-22 21:34:18 +0300 (, 22  2005) | 4 lines

Initial checkin of a Mac OS X port of puzzles, using Cocoa. All
puzzles are compiled together into a single monolithic application
which allows you to select each one from one of its menus.

------------------------------------------------------------------------
r5169 | simon | 2005-01-22 18:29:01 +0300 (, 22  2005) | 5 lines

Arrange that we really _can_ compile all the puzzles into a single
binary if we choose: fix bugs in cube.c and sixteen.c that manifest
when compiled that way, and introduce list.c which provides a global
list of all the available puzzles.

------------------------------------------------------------------------
r5126 | simon | 2005-01-17 16:48:57 +0300 (, 17  2005) | 7 lines

Rather than each game backend file exporting a whole load of
functions and a couple of variables, now each one exports a single
structure containing a load of function pointers and said variables.
This should make it easy to support platforms on which it's sensible
to compile all the puzzles into a single monolithic application. The
two existing platforms are still one-binary-per-game.

------------------------------------------------------------------------
r5019 | jacob | 2004-12-22 22:27:26 +0300 (, 22  2004) | 7 lines

Add a `jumble' key (`J') to Net, which scrambles the positions of all unlocked
tiles randomly. (Rachel asked for this; it's been being tested for a good few
months now, and Simon didn't care either way, so in it goes :)

As part of this, the front end can now be asked to provide a random random
seed (IYSWIM).

------------------------------------------------------------------------
r5007 | jacob | 2004-12-18 01:00:20 +0300 (, 18  2004) | 4 lines

Add grotty casts to prevent negative -> large positive conversion of cursor
position in Windows frontend; this showed up as a UI glitch while dragging to
the left/top of the window in Rectangles.

------------------------------------------------------------------------
r4957 | jacob | 2004-12-08 16:42:55 +0300 (, 08  2004) | 2 lines

Tweak Pattern doc for consistency with other puzzles.

------------------------------------------------------------------------
r4955 | simon | 2004-12-08 12:37:57 +0300 (, 08  2004) | 2 lines

Bah; r4954 introduced an array overrun.

------------------------------------------------------------------------
r4954 | simon | 2004-12-08 11:08:00 +0300 (, 08  2004) | 3 lines

Game completion detection was occasionally failing to spot a
lingering GRID_UNKNOWN, causing it to declare victory too soon.

------------------------------------------------------------------------
r4953 | simon | 2004-12-07 23:00:58 +0300 (, 07  2004) | 2 lines

New puzzle: `pattern'.

------------------------------------------------------------------------
r4813 | simon | 2004-11-18 14:30:39 +0300 (, 18  2004) | 4 lines

Move MODULE files out of individual project directories into a
MODULES top-level directory, which is where the Tartarus website
scripts will (hopefully) start reading them from.

------------------------------------------------------------------------
r4788 | simon | 2004-11-16 18:29:14 +0300 (, 16  2004) | 2 lines

Remove .cvsignore files on all active branches.

------------------------------------------------------------------------
r4787 | simon | 2004-11-16 18:27:00 +0300 (, 16  2004) | 6 lines

CVS revision numbers, stored as `cvs2svn:cvs-rev' properties, are a
useful piece of history in this repository but we don't want to
preserve their latest values on future commits. Accordingly, I'm
deleting them from all active development (though not from past
release branches).

------------------------------------------------------------------------
r4533 | simon | 2004-09-06 19:17:59 +0400 (, 06  2004) | 4 lines

Move the deactivate_timer() call from window_destroy() into
destroy(). I'm not sure how it cured the crash-on-quit bug, since it
was in completely the wrong place!

------------------------------------------------------------------------
r4525 | simon | 2004-09-01 15:46:51 +0400 (, 01  2004) | 4 lines

Deactivate the timer when we destroy the puzzle window. Otherwise it
might run again in mid-shutdown and cause chaos, if you hit `q' in
the middle of an animated sequence such as the Net finishing flash.

------------------------------------------------------------------------
r4477 | simon | 2004-08-17 23:59:14 +0400 (, 17  2004) | 3 lines

Now we have the `dir' parameter, we should use it where it makes
sense to do so.

------------------------------------------------------------------------
r4473 | simon | 2004-08-17 15:51:20 +0400 (, 17  2004) | 2 lines

Remove extraneous underscores at start and end of Rectangles seeds.

------------------------------------------------------------------------
r4470 | jacob | 2004-08-16 20:51:18 +0400 (, 16  2004) | 3 lines

Net's redraw function now uses the `dir' argument to determine whether it's
redrawing an undo. Seems to work.

------------------------------------------------------------------------
r4469 | jacob | 2004-08-16 20:29:54 +0400 (, 16  2004) | 6 lines

After discussion with Simon, the game redraw functions are now passed a new
argument `dir' which tells them whether this redraw is due to an undo, rather
than have them second-guess it from game state.
Note that none of the actual games yet take advantage of this; so it hasn't
been tested in anger (although it has been inspected by debugging).

------------------------------------------------------------------------
r4467 | jacob | 2004-08-16 17:54:41 +0400 (, 16  2004) | 2 lines

UI nit: make cursor visible upon use of A/S/D keyboard controls.

------------------------------------------------------------------------
r4466 | simon | 2004-08-16 17:52:06 +0400 (, 16  2004) | 3 lines

This repository needs to have a copy of mkfiles.pl, although really
I'd prefer to be able to share a single instance with PuTTY.

------------------------------------------------------------------------
r4465 | simon | 2004-08-16 17:17:40 +0400 (, 16  2004) | 3 lines

Clarify that difficulty does not increase forever as you increase
the expansion factor...

------------------------------------------------------------------------
r4464 | simon | 2004-08-16 17:10:07 +0400 (, 16  2004) | 2 lines

Robustness in the face of a completely configurable expansion factor.

------------------------------------------------------------------------
r4463 | simon | 2004-08-16 16:45:35 +0400 (, 16  2004) | 3 lines

Moved my puzzle collection out into ixion's main CVS area, so here's
a MODULE file.

------------------------------------------------------------------------
r4462 | simon | 2004-08-16 16:43:03 +0400 (, 16  2004) | 3 lines

Just for convenience, a docs Makefile, outside the main mkfiles.pl
structure.

------------------------------------------------------------------------
r4461 | simon | 2004-08-16 16:42:11 +0400 (, 16  2004) | 5 lines

Fold in the expanded-grid mechanism for generating different kinds
of puzzle. Configurable option, turned off by default, and not
propagated in game IDs (though you can explicitly specify it in
command-line parameters, and the docs explain how).

------------------------------------------------------------------------
r4460 | simon | 2004-08-16 16:23:56 +0400 (, 16  2004) | 2 lines

Added a help file, mostly thanks to Jacob.

------------------------------------------------------------------------
r4376 | simon | 2004-07-30 16:16:57 +0400 (, 30  2004) | 8 lines

Failed to connect up the `destroy' signal in error_box(), causing
gtk_main_quit not to get called, with the result that the whole game
ended up running one gtk_main level lower down. This meant that
final dialog box processing was not performed, so that (for example)
selecting 1x1 in Net, hitting OK and getting an error box, then
selecting a different size and hitting OK again failed to change to
the new size.

------------------------------------------------------------------------
r4322 | simon | 2004-07-05 14:32:26 +0400 (, 05  2004) | 2 lines

HACKING should be in .cvsignore.

------------------------------------------------------------------------
r4257 | simon | 2004-05-26 13:07:14 +0400 (, 26  2004) | 2 lines

Richard B's utterly evil `netslide': cross between Net and Sixteen.

------------------------------------------------------------------------
r4255 | simon | 2004-05-24 17:07:28 +0400 (, 24  2004) | 2 lines

Added the beginnings of a hacking guide.

------------------------------------------------------------------------
r4240 | simon | 2004-05-22 17:08:18 +0400 (, 22  2004) | 2 lines

makedist.sh should be silent.

------------------------------------------------------------------------
r4239 | simon | 2004-05-22 17:07:23 +0400 (, 22  2004) | 2 lines

Fix a memory leak.

------------------------------------------------------------------------
r4234 | simon | 2004-05-20 12:22:49 +0400 (, 20  2004) | 4 lines

Now that we have string-encodable game parameters, let's support a
command-line argument which is either a set of parameters or a
params+seed game ID.

------------------------------------------------------------------------
r4231 | simon | 2004-05-19 15:57:09 +0400 (, 19  2004) | 9 lines

Introduce routines in each game module to encode a set of game
parameters as a string, and decode it again. This is used in
midend.c to prepend the game parameters to the game seed, so that
copying out of the Specific box is sufficient to completely specify
the game you were playing.
Throughout development of these games I have referred to `seed'
internally, and `game ID' externally. Now there's a measurable
difference between them! :-)

------------------------------------------------------------------------
r4223 | simon | 2004-05-12 22:54:16 +0400 (, 12  2004) | 2 lines

Fix `visible' calculation (again).

------------------------------------------------------------------------
r4222 | simon | 2004-05-12 22:53:47 +0400 (, 12  2004) | 2 lines

Ahem. Seed validation was completely broken.

------------------------------------------------------------------------
r4221 | simon | 2004-05-12 22:45:11 +0400 (, 12  2004) | 6 lines

During redraws, I now do corner analysis centrally, which enables me
to maintain the `visible' array accurately and hence actually switch
it on. This prevents us having to redraw the entire playing area on
any move, which means really big grids are now sensibly playable
without display lag.

------------------------------------------------------------------------
r4220 | simon | 2004-05-12 22:28:11 +0400 (, 12  2004) | 4 lines

Remove vestigial code from the previous attempt at clever grid
generation. Grid generation should now be orders of magnitude faster
at large sizes.

------------------------------------------------------------------------
r4219 | simon | 2004-05-12 16:33:03 +0400 (, 12  2004) | 3 lines

Fiddle with the coordinate system to see if I can improve user
experience.

------------------------------------------------------------------------
r4218 | simon | 2004-05-12 16:32:27 +0400 (, 12  2004) | 2 lines

Flash on completion. Two people actually complained! :-)

------------------------------------------------------------------------
r4216 | simon | 2004-05-12 03:22:08 +0400 (, 12  2004) | 2 lines

Missing draw_update call.

------------------------------------------------------------------------
r4215 | simon | 2004-05-11 23:32:05 +0400 (, 11  2004) | 3 lines

Rename the Windows Net executable, due to its clash with the system
net.exe.

------------------------------------------------------------------------
r4214 | simon | 2004-05-11 23:24:22 +0400 (, 11  2004) | 3 lines

Now we have the UI abstraction, use it to implement keyboard control
in Net.

------------------------------------------------------------------------
r4213 | simon | 2004-05-11 22:46:36 +0400 (, 11  2004) | 4 lines

And I _always_ forget to clear the background when first drawing the
display of a new game, so I'll add it to nullgame.c and hope that
makes me remember it next time!

------------------------------------------------------------------------
r4212 | simon | 2004-05-11 22:46:10 +0400 (, 11  2004) | 2 lines

Cosmetic fixes for Windows.

------------------------------------------------------------------------
r4211 | simon | 2004-05-11 22:37:20 +0400 (, 11  2004) | 5 lines

Don't rush move animation to a conclusion on a subsequent keypress
unless there's actual activity happening as a result of the move.
Net animations were tending to get rushed to conclusion by the mouse
button release now that it's being reported to the mid-end.

------------------------------------------------------------------------
r4210 | simon | 2004-05-11 22:32:48 +0400 (, 11  2004) | 4 lines

We should turn off the dragging variables in the UI _whenever_
`enddrag' is TRUE, not just when the end of the drag was within a
sensible range.

------------------------------------------------------------------------
r4209 | simon | 2004-05-11 22:29:49 +0400 (, 11  2004) | 5 lines

Rectangles is now actually playable, since I've used the new UI
feature to arrange a mechanism that allows you to draw a whole
rectangle at a time by dragging rather than having to click each
edge individually.

------------------------------------------------------------------------
r4208 | simon | 2004-05-11 21:45:45 +0400 (, 11  2004) | 2 lines

Oops - missed a bit in the GTK front end :-)

------------------------------------------------------------------------
r4207 | simon | 2004-05-11 21:44:30 +0400 (, 11  2004) | 10 lines

Framework alteration: we now support a `game_ui' structure in
addition to the `game_state'. The new structure is intended to
contain ephemeral data pertaining to the game's user interface
rather than the actual game: things stored in the UI structure are
not restored in an Undo, for example.
make_move() is passed the UI to modify as it wishes; it is now
allowed to return the _same_ game_state it was passed, to indicate
that although no move has been made there has been a UI operation
requiring a redraw.

------------------------------------------------------------------------
r4206 | simon | 2004-05-11 21:06:50 +0400 (, 11  2004) | 2 lines

Added a new game, `Rectangles', taken from nikoli.co.jp.

------------------------------------------------------------------------
r4200 | simon | 2004-05-04 15:20:47 +0400 (, 04  2004) | 2 lines

Forgot to initialise the font variables in the Windows frontend structure.

------------------------------------------------------------------------
r4199 | simon | 2004-05-04 14:24:08 +0400 (, 04  2004) | 2 lines

Forgot to set up the initial value of checkboxes.

------------------------------------------------------------------------
r4198 | simon | 2004-05-04 13:56:38 +0400 (, 04  2004) | 3 lines

dupstr() should take a const char *. In particular, this allows
compilation under GTK 2.

------------------------------------------------------------------------
r4197 | simon | 2004-05-04 13:18:33 +0400 (, 04  2004) | 3 lines

Net puzzles more than 32 tiles wide weren't working properly due to
me testing the wrong variables for clicks on the tile border...

------------------------------------------------------------------------
r4196 | simon | 2004-05-04 12:33:28 +0400 (, 04  2004) | 3 lines

Peter Maydell points out that the README misspells `Makefile' as
`Makefile.gtk'.

------------------------------------------------------------------------
r4195 | simon | 2004-05-04 12:28:47 +0400 (, 04  2004) | 2 lines

Uninitialised variable caused ultra-wide windows. Silly.

------------------------------------------------------------------------
r4194 | simon | 2004-05-03 17:07:43 +0400 (, 03  2004) | 2 lines

Add a README.

------------------------------------------------------------------------
r4193 | simon | 2004-05-03 17:03:12 +0400 (, 03  2004) | 2 lines

Shell script to prepare a source distribution archive.

------------------------------------------------------------------------
r4192 | simon | 2004-05-03 16:48:13 +0400 (, 03  2004) | 2 lines

Add a licence file.

------------------------------------------------------------------------
r4191 | simon | 2004-05-03 16:12:30 +0400 (, 03  2004) | 5 lines

Redraws during undo in Sixteen had been broken by my faffing about
with last_movement_sense (which was necessary to fix the animation
when the grid was only 2 squares wide in either dimension). Movement
sense is now inverted if the move being animated is an undo.

------------------------------------------------------------------------
r4189 | simon | 2004-05-03 13:43:08 +0400 (, 03  2004) | 8 lines

GTK and Windows appear to handle timers very differently:
specifically, the elapsed time between calls varies much more with
GTK than it does under Windows. Therefore, I now take my own time
readings on every timer call, and this appears to have made the
animations run at closer to the same speed between platforms. Having
done that, I decided some of them were at the _wrong_ speed, and
fiddled with each game's timings as well.

------------------------------------------------------------------------
r4188 | simon | 2004-05-03 13:19:34 +0400 (, 03  2004) | 2 lines

Make Return and Escape work reliably in GTK dialog boxes.

------------------------------------------------------------------------
r4187 | simon | 2004-05-03 13:10:52 +0400 (, 03  2004) | 12 lines

The Windows RNG turns out to only give about 16 bits at a time. This
is (a) pretty feeble, and (b) means that although Net seeds transfer
between platforms and still generate the same game, there's a
suspicious discrepancy in the typical seed _generated_ by each
platform.
I have a better RNG kicking around in this code base already, so
I'll just use it. Each midend has its own random_state, which it
passes to new_game_seed() as required. A handy consequence of this
is that initial seed data is now passed to midend_new(), which means
that new platform implementors are unlikely to forget to seed the
RNG because failure to do so causes a compile error!

------------------------------------------------------------------------
r4186 | simon | 2004-05-03 12:51:31 +0400 (, 03  2004) | 6 lines

Implement selection of game seeds, by reusing the config box
mechanism I've just invented (the midend handles the standard game
selection configuration). Each game is now required to validate its
own seed data before attempting to base a game on it and potentially
confusing itself.

------------------------------------------------------------------------
r4185 | simon | 2004-05-03 11:56:23 +0400 (, 03  2004) | 4 lines

`Fifteen' was getting the parity wrong on any size of board where
the top left and bottom right corners didn't have the same
chessboard colour.

------------------------------------------------------------------------
r4184 | simon | 2004-05-03 11:52:33 +0400 (, 03  2004) | 7 lines

Game configuration box for Windows, by constructing the dialog box
right from scratch without the slightest reference to any dialog
templates (meaning that we get to figure out the layout and _then_
choose the window size). I'm rather pleased with that. Also
introduced free_cfg(), which is why this checkin touched gtk.c as
well.

------------------------------------------------------------------------
r4183 | simon | 2004-05-02 14:43:46 +0400 (, 02  2004) | 2 lines

`BOOLEAN' is a term already used by Win32. Bah. Change terminology.

------------------------------------------------------------------------
r4182 | simon | 2004-05-01 15:32:12 +0400 (, 01  2004) | 2 lines

Configuration dialog box, on the GTK front end only as yet.

------------------------------------------------------------------------
r4181 | simon | 2004-05-01 12:58:48 +0400 (, 01  2004) | 3 lines

Remove arbitrary restriction on Net minimum game size. (Awww, cute
2x2! Cuter 2x1!)

------------------------------------------------------------------------
r4180 | simon | 2004-05-01 11:53:53 +0400 (, 01  2004) | 4 lines

Wrap the status bar in a viewport, to avoid it expanding if the text
doesn't fit in it. This not only looked ugly, but caused unnecessary
calls to configure_area() and kept destroying the pixmap.

------------------------------------------------------------------------
r4179 | simon | 2004-05-01 11:32:09 +0400 (, 01  2004) | 5 lines

The cube was being drawn slightly differently on the top and left
rows, because the coordinates were crossing one or other axis at
that point and so the lower coordinate was being rounded up while
the upper one was rounded down. Judicious use of floor() fixes it.

------------------------------------------------------------------------
r4177 | simon | 2004-04-30 14:17:22 +0400 (, 30  2004) | 2 lines

Keep the status bar in better sync with the game display.

------------------------------------------------------------------------
r4176 | simon | 2004-04-30 14:14:55 +0400 (, 30  2004) | 2 lines

We were forgetting to count the final move.

------------------------------------------------------------------------
r4175 | simon | 2004-04-30 14:11:53 +0400 (, 30  2004) | 3 lines

Incorrect placing of the polyhedron sometimes left it on a blue
square. Oops.

------------------------------------------------------------------------
r4174 | simon | 2004-04-29 23:23:08 +0400 (, 29  2004) | 2 lines

Added a status bar.

------------------------------------------------------------------------
r4173 | simon | 2004-04-29 22:10:22 +0400 (, 29  2004) | 3 lines

Implemented text and clipping primitives in the frontend, and added
two new simple games `fifteen' and `sixteen'.

------------------------------------------------------------------------
r4170 | simon | 2004-04-29 13:15:42 +0400 (, 29  2004) | 2 lines

`There's always one'. Add nullgame to .cvsignore.

------------------------------------------------------------------------
r4169 | simon | 2004-04-29 12:37:19 +0400 (, 29  2004) | 2 lines

Add a template file defining the null game.

------------------------------------------------------------------------
r4168 | simon | 2004-04-28 22:43:50 +0400 (, 28  2004) | 12 lines

Add a new game concept called a `flash'. This is a graphical effect
taking non-zero time, which is triggered by the making of a move and
is _not_ hurried to its conclusion by the start of the next move (so
the game redraw function is expected to be able to draw it in
parallel with continuing moves). The only thing that prematurely
terminates a flash is the start of a fresh flash. In particular,
this concept is used to display the completion flash in Net, because
at least _my_ playing instincts make me lock every piece I've
unambiguously placed, and hence the last turn move is instantly
followed by a lock move which was previously suppressing the
completion flash.

------------------------------------------------------------------------
r4167 | simon | 2004-04-28 21:46:04 +0400 (, 28  2004) | 2 lines

Have each game declare a name which is used for window titles etc.

------------------------------------------------------------------------
r4166 | simon | 2004-04-28 21:42:32 +0400 (, 28  2004) | 4 lines

Shift-click is equivalent to middle-click. This is mostly for
Windows users who may not have a middle button at all, but I've
replicated it in GTK to maintain cross-platform consistency.

------------------------------------------------------------------------
r4165 | simon | 2004-04-28 21:37:13 +0400 (, 28  2004) | 2 lines

Fix zillions of MSVC compiler warnings. Sigh.

------------------------------------------------------------------------
r4162 | simon | 2004-04-28 21:21:57 +0400 (, 28  2004) | 5 lines

Introduce diagonal movement keys on the numeric keypad, and use them
as an alternative control method in Cube. (This was a bit of hassle
in the Windows front end; I also introduced a debugging framework
and made TranslateMessage conditional.)

------------------------------------------------------------------------
r4160 | simon | 2004-04-28 16:39:39 +0400 (, 28  2004) | 2 lines

Add .map and .rsp files to .cvsignore.

------------------------------------------------------------------------
r4159 | simon | 2004-04-28 16:34:37 +0400 (, 28  2004) | 3 lines

More robust timer handling in GTK: never create a new timer when one
is already active.

------------------------------------------------------------------------
r4158 | simon | 2004-04-28 16:07:15 +0400 (, 28  2004) | 6 lines

Add a menu bar, in both Windows and GTK. In particular, game modules
are now expected to provide a list of `presets' (game_params plus a
name) which are selectable from the menu. This means I can play
both Octahedron and Cube without recompiling in between :-)
While I'm here, also enabled a Cygwin makefile, which Just Worked.

------------------------------------------------------------------------
r4157 | simon | 2004-04-28 02:49:21 +0400 (, 28  2004) | 6 lines

A-_ha_! The Windows Rectangle() call appears to get uppity if asked
to draw a 1x1 rectangle, presumably on the grounds that that's
beneath its dignity and you ought to be using SetPixel() instead. So
now I do, and now Net actually looks exactly the same on Windows and
GTK. Woo!

------------------------------------------------------------------------
r4156 | simon | 2004-04-28 00:51:08 +0400 (, 28  2004) | 4 lines

Most of a Windows front end. Something's not _quite_ right in the
GDI - there are blobs in the middle of powered lines in Net. But
it's 99% there now.

------------------------------------------------------------------------
r4155 | simon | 2004-04-27 23:01:49 +0400 (, 27  2004) | 2 lines

Stop the user being able to resize the window.

------------------------------------------------------------------------
r4151 | simon | 2004-04-27 21:44:30 +0400 (, 27  2004) | 3 lines

Implemented Cube, in a sufficiently general way that it also handles
the tetrahedron, octahedron and icosahedron.

------------------------------------------------------------------------
r4145 | simon | 2004-04-26 21:10:44 +0400 (, 26  2004) | 3 lines

Further general development. Net is now playable, though
configuration is absent as yet.

------------------------------------------------------------------------
r4141 | simon | 2004-04-26 00:15:22 +0400 (, 26  2004) | 3 lines

General further development. Sketched out the mid-end, added more
GTK code, rudiments of event passing.

------------------------------------------------------------------------
r4139 | simon | 2004-04-25 18:45:22 +0400 (, 25  2004) | 3 lines

Beginnings of a GTK framework. (And I do mean _beginnings_; it opens
a window and that's about it.)

------------------------------------------------------------------------
r4138 | simon | 2004-04-25 18:27:58 +0400 (, 25  2004) | 3 lines

Initial checkin of a portable framework for writing small GUI puzzle
games.

------------------------------------------------------------------------
