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.


git-svn-id: svn://svn.tartarus.org/sgt/puzzles@9494 cda61777-01e9-0310-a592-d414129be87e
Stop using the deprecated NSString stringWithCString: methods.


git-svn-id: svn://svn.tartarus.org/sgt/puzzles@9495 cda61777-01e9-0310-a592-d414129be87e
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.


git-svn-id: svn://svn.tartarus.org/sgt/puzzles@9498 cda61777-01e9-0310-a592-d414129be87e
GNUstep compatibility: spell null selectors "NULL", not "nil".


git-svn-id: svn://svn.tartarus.org/sgt/puzzles@9499 cda61777-01e9-0310-a592-d414129be87e
GNUstep compatibility: comment out some API calls that GNUstep
apparently doesn't have. Fortunately they were optional anyway.


git-svn-id: svn://svn.tartarus.org/sgt/puzzles@9500 cda61777-01e9-0310-a592-d414129be87e
GNUstep compatibility: remove an unused variable which the compiler
warned about.


git-svn-id: svn://svn.tartarus.org/sgt/puzzles@9501 cda61777-01e9-0310-a592-d414129be87e
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.


git-svn-id: svn://svn.tartarus.org/sgt/puzzles@9502 cda61777-01e9-0310-a592-d414129be87e
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.


git-svn-id: svn://svn.tartarus.org/sgt/puzzles@9503 cda61777-01e9-0310-a592-d414129be87e
GNUstep compatibility: add a missing #include.


git-svn-id: svn://svn.tartarus.org/sgt/puzzles@9504 cda61777-01e9-0310-a592-d414129be87e
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.


git-svn-id: svn://svn.tartarus.org/sgt/puzzles@9505 cda61777-01e9-0310-a592-d414129be87e
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.


git-svn-id: svn://svn.tartarus.org/sgt/puzzles@9533 cda61777-01e9-0310-a592-d414129be87e
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.


git-svn-id: svn://svn.tartarus.org/sgt/puzzles@9534 cda61777-01e9-0310-a592-d414129be87e
Bridges solver fix: in map_update_possibles, collect values from
maxh/maxv for squares between islands as well as on islands.


git-svn-id: svn://svn.tartarus.org/sgt/puzzles@9542 cda61777-01e9-0310-a592-d414129be87e
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


git-svn-id: svn://svn.tartarus.org/sgt/puzzles@9543 cda61777-01e9-0310-a592-d414129be87e
Write a comment outlining a design for a rewritten faster solver.


git-svn-id: svn://svn.tartarus.org/sgt/puzzles@9544 cda61777-01e9-0310-a592-d414129be87e
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.)


git-svn-id: svn://svn.tartarus.org/sgt/puzzles@9546 cda61777-01e9-0310-a592-d414129be87e
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.


git-svn-id: svn://svn.tartarus.org/sgt/puzzles@9547 cda61777-01e9-0310-a592-d414129be87e
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.


git-svn-id: svn://svn.tartarus.org/sgt/puzzles@9548 cda61777-01e9-0310-a592-d414129be87e
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!


git-svn-id: svn://svn.tartarus.org/sgt/puzzles@9549 cda61777-01e9-0310-a592-d414129be87e
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.


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