163 Commits

Author SHA1 Message Date
1c77e0df94 markup typo
[originally from svn r5739]
2005-05-04 12:24:16 +00:00
b32b4f8763 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.

[originally from svn r5737]
2005-05-02 16:59:50 +00:00
cf7988afb3 Fix line endings when pasting on Windows.
[originally from svn r5736]
2005-05-02 16:37:20 +00:00
82b8e2faf5 Forgot to mention that you can undo a Solve operation.
[originally from svn r5734]
2005-05-02 13:27:59 +00:00
c2273f2718 Ahem. The `Solve' option in orientable Twiddle needs to correct the
orientations as well as the order!

[originally from svn r5733]
2005-05-02 13:22:25 +00:00
d8cc157c55 Silly (but harmless) typo.
[originally from svn r5732]
2005-05-02 13:18:24 +00:00
4f7b65de2e 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!

[originally from svn r5731]
2005-05-02 13:17:10 +00:00
aea7b61815 Oops; forgot to check in the copy-to-clipboard option for Windows.
[originally from svn r5730]
2005-05-02 10:55:32 +00:00
9e240e45df 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.

[originally from svn r5729]
2005-05-02 10:12:26 +00:00
3f9d88f3e7 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.

[originally from svn r5728]
2005-05-02 09:42:09 +00:00
28f655c821 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.

[originally from svn r5727]
2005-05-01 14:05:03 +00:00
850a70a03c Copy-to-clipboard for Rectangles.
[originally from svn r5726]
2005-05-01 13:51:46 +00:00
cb413f837b Copy-to-clipboard facility for Fifteen, Sixteen and Twiddle.
[originally from svn r5725]
2005-05-01 13:22:44 +00:00
791940b043 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.

[originally from svn r5724]
2005-05-01 12:53:41 +00:00
e72931bfe2 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.

[originally from svn r5723]
2005-05-01 11:07:13 +00:00
5649e20ef2 Remove outdated comment :-)
[originally from svn r5722]
2005-05-01 10:57:47 +00:00
6aca542184 I think Windows fonts look better in bold as well.
[originally from svn r5721]
2005-05-01 10:57:23 +00:00
90db70378e 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.

[originally from svn r5718]
2005-04-30 14:50:33 +00:00
9b870146f7 After brainstorming with Gareth, we've decided that this is a much
simpler and better way to indicate tile orientation than those
colour bars.

[originally from svn r5717]
2005-04-30 14:38:20 +00:00
d40b3172fe Bah, and of course there's a TODO comment I forgot to remove.
[originally from svn r5714]
2005-04-30 14:14:37 +00:00
d35f64096d 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!

[originally from svn r5713]
2005-04-30 14:14:14 +00:00
f5ae256b77 Pango-derived fonts seem to generally look better if I ask for them
in bold.

[originally from svn r5709]
2005-04-30 13:11:22 +00:00
3be19aed94 New puzzle: `twiddle', generalised from a random door-unlocking
gadget in Metroid Prime 2.

[originally from svn r5708]
2005-04-30 12:54:22 +00:00
79a77d53e1 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.

[originally from svn r5707]
2005-04-29 17:07:19 +00:00
d55d0b53f3 Correct block coordinate display when standalone solver shows its
working.

[originally from svn r5706]
2005-04-29 08:11:01 +00:00
df133c2297 Aha, even better: a Makefile hack that causes auto-detection of GTK
2 and fallback to GTK 1.2.

[originally from svn r5705]
2005-04-28 12:50:56 +00:00
3d4f276f1f 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).

[originally from svn r5694]
2005-04-27 19:44:34 +00:00
37a0c1af6a 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.

[originally from svn r5693]
2005-04-27 19:39:20 +00:00
8b31b4606c Command-line solver was dividing up non-square puzzles the wrong way
round.

[originally from svn r5691]
2005-04-27 16:59:18 +00:00
4ba97c64fe Pattern also contains an internal solver, so here's a command-line
interface to it just in case it comes in handy.

[originally from svn r5686]
2005-04-27 11:13:33 +00:00
37ad6698a5 The command-line solver's difficulty gradings now use the same
terminology as the puzzle GUI.

[originally from svn r5683]
2005-04-26 17:03:56 +00:00
070fb537cf 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.

[originally from svn r5682]
2005-04-26 11:19:00 +00:00
22ab2c0b82 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.

[originally from svn r5681]
2005-04-26 08:20:25 +00:00
80129693bb Remove some legacy debugging code which was breaking the MinGW
build, and which is redundant given the new standalone solver
functionality.

[originally from svn r5672]
2005-04-25 14:37:33 +00:00
0fffbf32db Oops; _actually_ add the reasoning mode I mentioned in the last
checkin.

[originally from svn r5671]
2005-04-25 14:17:14 +00:00
a163926ed5 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).

[originally from svn r5670]
2005-04-25 14:03:53 +00:00
6bf62f4577 Outstandingly cute mathematical transformation which allows me to
lose a lot of code duplication in nsolve while preserving efficiency.

[originally from svn r5667]
2005-04-24 10:06:47 +00:00
f5138782b1 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.

[originally from svn r5666]
2005-04-24 09:21:57 +00:00
3346ae2e54 Doc tweaks for Solo.
[originally from svn r5665]
2005-04-23 18:16:54 +00:00
c7085f0ffb 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.

[originally from svn r5662]
2005-04-23 17:09:19 +00:00
5b1235c369 Visual C points out a couple of typos.
[originally from svn r5661]
2005-04-23 16:41:35 +00:00
0c55b7e16f Initial checkin of `Solo', the number-placing puzzle popularised by
the Times under the name `Sudoku'.

[originally from svn r5660]
2005-04-23 16:35:28 +00:00
134418abf7 Oops. Just noticed that the Windows front end completely ignores the
`colour' parameter in draw_text().

[originally from svn r5507]
2005-03-15 14:24:45 +00:00
f64dcb909d 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!

[originally from svn r5391]
2005-02-24 09:13:06 +00:00
e500ef9637 Fixes in grid generation for pedantic special cases when one or both
grid dimensions are very small.

[originally from svn r5390]
2005-02-24 08:13:32 +00:00
1c05db3fb5 I've found NSView's setNeedsDisplayInRect: method, which is
obviously better than just calling setNeedsDisplay on the whole
thing...

[originally from svn r5258]
2005-02-05 16:43:13 +00:00
c7b06e9c3a 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.

[originally from svn r5210]
2005-01-25 21:19:28 +00:00
e4306a6036 Sanitising the mouse input data was a good idea, but my
implementation sucked. Revise it completely.

[originally from svn r5209]
2005-01-25 18:07:08 +00:00
8b91de196c 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.

[originally from svn r5208]
2005-01-25 14:07:46 +00:00
8ae25046d8 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.

[originally from svn r5205]
2005-01-25 09:07:54 +00:00