sgt/puzzles
19 years agoSimplify clip region handling under Windows, which also makes Solo's
simon [Sat, 23 Apr 2005 17:09:19 +0000 (17:09 +0000)]
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.

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

19 years agoVisual C points out a couple of typos.
simon [Sat, 23 Apr 2005 16:41:35 +0000 (16:41 +0000)]
Visual C points out a couple of typos.

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

19 years agoInitial checkin of `Solo', the number-placing puzzle popularised by
simon [Sat, 23 Apr 2005 16:35:28 +0000 (16:35 +0000)]
Initial checkin of `Solo', the number-placing puzzle popularised by
the Times under the name `Sudoku'.

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

19 years agoOops. Just noticed that the Windows front end completely ignores the
simon [Tue, 15 Mar 2005 14:24:45 +0000 (14:24 +0000)]
Oops. Just noticed that the Windows front end completely ignores the
`colour' parameter in draw_text().

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

19 years agoStop the Pattern grid generation from generating an entire row or
simon [Thu, 24 Feb 2005 09:13:06 +0000 (09:13 +0000)]
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!

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

19 years agoFixes in grid generation for pedantic special cases when one or both
simon [Thu, 24 Feb 2005 08:13:32 +0000 (08:13 +0000)]
Fixes in grid generation for pedantic special cases when one or both
grid dimensions are very small.

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

19 years agoI've found NSView's setNeedsDisplayInRect: method, which is
simon [Sat, 5 Feb 2005 16:43:13 +0000 (16:43 +0000)]
I've found NSView's setNeedsDisplayInRect: method, which is
obviously better than just calling setNeedsDisplay on the whole
thing...

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

19 years agoNeed to impose a _maximum_ width on edit boxes, as well as a minimum
simon [Tue, 25 Jan 2005 21:19:28 +0000 (21:19 +0000)]
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.

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

19 years agoSanitising the mouse input data was a good idea, but my
simon [Tue, 25 Jan 2005 18:07:08 +0000 (18:07 +0000)]
Sanitising the mouse input data was a good idea, but my
implementation sucked. Revise it completely.

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

19 years agoInclude code in midend.c to sanitise streams of mouse events so that
simon [Tue, 25 Jan 2005 14:07:46 +0000 (14:07 +0000)]
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.

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

19 years agoAhem. Lots of stuff, including the new OS X sources, was being left
simon [Tue, 25 Jan 2005 09:07:54 +0000 (09:07 +0000)]
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.

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

19 years agoUpdates for OS X port (including updating copyright statements).
simon [Mon, 24 Jan 2005 15:45:37 +0000 (15:45 +0000)]
Updates for OS X port (including updating copyright statements).

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

19 years agoAhem. Rogue copy and paste was causing preset menu items to go into
simon [Mon, 24 Jan 2005 14:10:16 +0000 (14:10 +0000)]
Ahem. Rogue copy and paste was causing preset menu items to go into
the Help menu rather than the Type menu. Fixed.

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

19 years ago`make release' target, which builds a .dmg disk image in what
simon [Mon, 24 Jan 2005 13:44:24 +0000 (13:44 +0000)]
`make release' target, which builds a .dmg disk image in what
appears to be the approved Apple fashion.

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

19 years agoHelp should have the shortcut Command-?.
simon [Mon, 24 Jan 2005 13:04:37 +0000 (13:04 +0000)]
Help should have the shortcut Command-?.

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

19 years agoImprove OS X help: split back up into multiple files (thanks to
simon [Mon, 24 Jan 2005 13:00:11 +0000 (13:00 +0000)]
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.

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

19 years agoThe #definition of COMBINED was done very badly: it was a piece of
simon [Mon, 24 Jan 2005 12:09:51 +0000 (12:09 +0000)]
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.

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

19 years agoFirst cut at online help under OS X. I just built the HTML version
simon [Mon, 24 Jan 2005 12:05:21 +0000 (12:05 +0000)]
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!

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

19 years agoThe main grid outline in Pattern was asymmetric between the top/left
simon [Mon, 24 Jan 2005 10:50:17 +0000 (10:50 +0000)]
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.)

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

19 years agoFix two window-resizing bugs introduced by the addition of the status bar.
simon [Mon, 24 Jan 2005 10:45:23 +0000 (10:45 +0000)]
Fix two window-resizing bugs introduced by the addition of the status bar.

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

19 years agoImprove fatal error handling.
simon [Mon, 24 Jan 2005 10:35:54 +0000 (10:35 +0000)]
Improve fatal error handling.

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

19 years agoAdded a dock menu which makes it more convenient to launch a new
simon [Mon, 24 Jan 2005 07:42:01 +0000 (07:42 +0000)]
Added a dock menu which makes it more convenient to launch a new
game window.

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

19 years agoStatus bar support.
simon [Mon, 24 Jan 2005 07:37:50 +0000 (07:37 +0000)]
Status bar support.

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

19 years agoImplemented the configurable dialog box mechanism, allowing custom
simon [Sun, 23 Jan 2005 22:28:18 +0000 (22:28 +0000)]
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_.

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

19 years agoAdded a framework for putting things other than the binary into a
simon [Sun, 23 Jan 2005 11:20:31 +0000 (11:20 +0000)]
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.

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

19 years agoAh, no, _that_ fixes the malloc problem. I'd forgotten that midend.c
simon [Sun, 23 Jan 2005 09:59:45 +0000 (09:59 +0000)]
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.

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

19 years agoI _think_ this has just fixed an uninitialised-memory bug, but I'm
simon [Sun, 23 Jan 2005 09:37:16 +0000 (09:37 +0000)]
I _think_ this has just fixed an uninitialised-memory bug, but I'm
not sure.

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

19 years agoDynamically frob the menu bar to achieve selection of game presets.
simon [Sun, 23 Jan 2005 09:17:46 +0000 (09:17 +0000)]
Dynamically frob the menu bar to achieve selection of game presets.

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

19 years agoFlesh out the menus a bit.
simon [Sun, 23 Jan 2005 08:36:24 +0000 (08:36 +0000)]
Flesh out the menus a bit.

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

19 years agoUpdate TODO.
simon [Sat, 22 Jan 2005 18:46:51 +0000 (18:46 +0000)]
Update TODO.

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

19 years agoInitial checkin of a Mac OS X port of puzzles, using Cocoa. All
simon [Sat, 22 Jan 2005 18:34:18 +0000 (18:34 +0000)]
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.

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

19 years agoArrange that we really _can_ compile all the puzzles into a single
simon [Sat, 22 Jan 2005 15:29:01 +0000 (15:29 +0000)]
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.

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

19 years agoRather than each game backend file exporting a whole load of
simon [Mon, 17 Jan 2005 13:48:57 +0000 (13:48 +0000)]
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.

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

19 years agoAdd a `jumble' key (`J') to Net, which scrambles the positions of all unlocked
jacob [Wed, 22 Dec 2004 19:27:26 +0000 (19:27 +0000)]
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).

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

19 years agoAdd grotty casts to prevent negative -> large positive conversion of cursor
jacob [Fri, 17 Dec 2004 22:00:20 +0000 (22:00 +0000)]
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.

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

19 years agoTweak Pattern doc for consistency with other puzzles.
jacob [Wed, 8 Dec 2004 13:42:55 +0000 (13:42 +0000)]
Tweak Pattern doc for consistency with other puzzles.

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

19 years agoBah; r4954 introduced an array overrun.
simon [Wed, 8 Dec 2004 09:37:57 +0000 (09:37 +0000)]
Bah; r4954 introduced an array overrun.

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

19 years agoGame completion detection was occasionally failing to spot a
simon [Wed, 8 Dec 2004 08:08:00 +0000 (08:08 +0000)]
Game completion detection was occasionally failing to spot a
lingering GRID_UNKNOWN, causing it to declare victory too soon.

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

19 years agoNew puzzle: `pattern'.
simon [Tue, 7 Dec 2004 20:00:58 +0000 (20:00 +0000)]
New puzzle: `pattern'.

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

19 years agoMove MODULE files out of individual project directories into a
simon [Thu, 18 Nov 2004 11:30:39 +0000 (11:30 +0000)]
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.

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

19 years agoRemove .cvsignore files on all active branches.
simon [Tue, 16 Nov 2004 15:29:14 +0000 (15:29 +0000)]
Remove .cvsignore files on all active branches.

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

19 years agoCVS revision numbers, stored as `cvs2svn:cvs-rev' properties, are a
simon [Tue, 16 Nov 2004 15:27:00 +0000 (15:27 +0000)]
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).

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

19 years agoMove the deactivate_timer() call from window_destroy() into
simon [Mon, 6 Sep 2004 15:17:59 +0000 (15:17 +0000)]
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!

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

19 years agoDeactivate the timer when we destroy the puzzle window. Otherwise it
simon [Wed, 1 Sep 2004 11:46:51 +0000 (11:46 +0000)]
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.

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

19 years agoNow we have the `dir' parameter, we should use it where it makes
simon [Tue, 17 Aug 2004 19:59:14 +0000 (19:59 +0000)]
Now we have the `dir' parameter, we should use it where it makes
sense to do so.

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

19 years agoRemove extraneous underscores at start and end of Rectangles seeds.
simon [Tue, 17 Aug 2004 11:51:20 +0000 (11:51 +0000)]
Remove extraneous underscores at start and end of Rectangles seeds.

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

19 years agoNet's redraw function now uses the `dir' argument to determine whether it's
jacob [Mon, 16 Aug 2004 16:51:18 +0000 (16:51 +0000)]
Net's redraw function now uses the `dir' argument to determine whether it's
redrawing an undo. Seems to work.

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

19 years agoAfter discussion with Simon, the game redraw functions are now passed a new
jacob [Mon, 16 Aug 2004 16:29:54 +0000 (16:29 +0000)]
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).

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

19 years agoUI nit: make cursor visible upon use of A/S/D keyboard controls.
jacob [Mon, 16 Aug 2004 13:54:41 +0000 (13:54 +0000)]
UI nit: make cursor visible upon use of A/S/D keyboard controls.

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

19 years agoThis repository needs to have a copy of mkfiles.pl, although really
simon [Mon, 16 Aug 2004 13:52:06 +0000 (13:52 +0000)]
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.

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

19 years agoClarify that difficulty does not increase forever as you increase
simon [Mon, 16 Aug 2004 13:17:40 +0000 (13:17 +0000)]
Clarify that difficulty does not increase forever as you increase
the expansion factor...

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

19 years agoRobustness in the face of a completely configurable expansion factor.
simon [Mon, 16 Aug 2004 13:10:07 +0000 (13:10 +0000)]
Robustness in the face of a completely configurable expansion factor.

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

19 years agoMoved my puzzle collection out into ixion's main CVS area, so here's
simon [Mon, 16 Aug 2004 12:45:35 +0000 (12:45 +0000)]
Moved my puzzle collection out into ixion's main CVS area, so here's
a MODULE file.

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

19 years agoJust for convenience, a docs Makefile, outside the main mkfiles.pl
simon [Mon, 16 Aug 2004 12:43:03 +0000 (12:43 +0000)]
Just for convenience, a docs Makefile, outside the main mkfiles.pl
structure.

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

19 years agoFold in the expanded-grid mechanism for generating different kinds
simon [Mon, 16 Aug 2004 12:42:11 +0000 (12:42 +0000)]
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).

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

19 years agoAdded a help file, mostly thanks to Jacob.
simon [Mon, 16 Aug 2004 12:23:56 +0000 (12:23 +0000)]
Added a help file, mostly thanks to Jacob.

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

19 years agoFailed to connect up the `destroy' signal in error_box(), causing
simon [Fri, 30 Jul 2004 12:16:57 +0000 (12:16 +0000)]
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.

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

19 years agoHACKING should be in .cvsignore.
simon [Mon, 5 Jul 2004 10:32:26 +0000 (10:32 +0000)]
HACKING should be in .cvsignore.

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

20 years agoRichard B's utterly evil `netslide': cross between Net and Sixteen.
simon [Wed, 26 May 2004 09:07:14 +0000 (09:07 +0000)]
Richard B's utterly evil `netslide': cross between Net and Sixteen.

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

20 years agoAdded the beginnings of a hacking guide.
simon [Mon, 24 May 2004 13:07:28 +0000 (13:07 +0000)]
Added the beginnings of a hacking guide.

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

20 years agomakedist.sh should be silent.
simon [Sat, 22 May 2004 13:08:18 +0000 (13:08 +0000)]
makedist.sh should be silent.

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

20 years agoFix a memory leak.
simon [Sat, 22 May 2004 13:07:23 +0000 (13:07 +0000)]
Fix a memory leak.

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

20 years agoNow that we have string-encodable game parameters, let's support a
simon [Thu, 20 May 2004 08:22:49 +0000 (08:22 +0000)]
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.

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

20 years agoIntroduce routines in each game module to encode a set of game
simon [Wed, 19 May 2004 11:57:09 +0000 (11:57 +0000)]
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! :-)

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

20 years agoFix `visible' calculation (again).
simon [Wed, 12 May 2004 18:54:16 +0000 (18:54 +0000)]
Fix `visible' calculation (again).

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

20 years agoAhem. Seed validation was completely broken.
simon [Wed, 12 May 2004 18:53:47 +0000 (18:53 +0000)]
Ahem. Seed validation was completely broken.

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

20 years agoDuring redraws, I now do corner analysis centrally, which enables me
simon [Wed, 12 May 2004 18:45:11 +0000 (18:45 +0000)]
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.

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

20 years agoRemove vestigial code from the previous attempt at clever grid
simon [Wed, 12 May 2004 18:28:11 +0000 (18:28 +0000)]
Remove vestigial code from the previous attempt at clever grid
generation. Grid generation should now be orders of magnitude faster
at large sizes.

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

20 years agoFiddle with the coordinate system to see if I can improve user
simon [Wed, 12 May 2004 12:33:03 +0000 (12:33 +0000)]
Fiddle with the coordinate system to see if I can improve user
experience.

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

20 years agoFlash on completion. Two people actually complained! :-)
simon [Wed, 12 May 2004 12:32:27 +0000 (12:32 +0000)]
Flash on completion. Two people actually complained! :-)

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

20 years agoMissing draw_update call.
simon [Tue, 11 May 2004 23:22:08 +0000 (23:22 +0000)]
Missing draw_update call.

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

20 years agoRename the Windows Net executable, due to its clash with the system
simon [Tue, 11 May 2004 19:32:05 +0000 (19:32 +0000)]
Rename the Windows Net executable, due to its clash with the system
net.exe.

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

20 years agoNow we have the UI abstraction, use it to implement keyboard control
simon [Tue, 11 May 2004 19:24:22 +0000 (19:24 +0000)]
Now we have the UI abstraction, use it to implement keyboard control
in Net.

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

20 years agoAnd I _always_ forget to clear the background when first drawing the
simon [Tue, 11 May 2004 18:46:36 +0000 (18:46 +0000)]
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!

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

20 years agoCosmetic fixes for Windows.
simon [Tue, 11 May 2004 18:46:10 +0000 (18:46 +0000)]
Cosmetic fixes for Windows.

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

20 years agoDon't rush move animation to a conclusion on a subsequent keypress
simon [Tue, 11 May 2004 18:37:20 +0000 (18:37 +0000)]
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.

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

20 years agoWe should turn off the dragging variables in the UI _whenever_
simon [Tue, 11 May 2004 18:32:48 +0000 (18:32 +0000)]
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.

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

20 years agoRectangles is now actually playable, since I've used the new UI
simon [Tue, 11 May 2004 18:29:49 +0000 (18:29 +0000)]
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.

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

20 years agoOops - missed a bit in the GTK front end :-)
simon [Tue, 11 May 2004 17:45:45 +0000 (17:45 +0000)]
Oops - missed a bit in the GTK front end :-)

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

20 years agoFramework alteration: we now support a `game_ui' structure in
simon [Tue, 11 May 2004 17:44:30 +0000 (17:44 +0000)]
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.

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

20 years agoAdded a new game, `Rectangles', taken from nikoli.co.jp.
simon [Tue, 11 May 2004 17:06:50 +0000 (17:06 +0000)]
Added a new game, `Rectangles', taken from nikoli.co.jp.

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

20 years agoForgot to initialise the font variables in the Windows frontend structure.
simon [Tue, 4 May 2004 11:20:47 +0000 (11:20 +0000)]
Forgot to initialise the font variables in the Windows frontend structure.

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

20 years agoForgot to set up the initial value of checkboxes.
simon [Tue, 4 May 2004 10:24:08 +0000 (10:24 +0000)]
Forgot to set up the initial value of checkboxes.

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

20 years agodupstr() should take a const char *. In particular, this allows
simon [Tue, 4 May 2004 09:56:38 +0000 (09:56 +0000)]
dupstr() should take a const char *. In particular, this allows
compilation under GTK 2.

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

20 years agoNet puzzles more than 32 tiles wide weren't working properly due to
simon [Tue, 4 May 2004 09:18:33 +0000 (09:18 +0000)]
Net puzzles more than 32 tiles wide weren't working properly due to
me testing the wrong variables for clicks on the tile border...

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

20 years agoPeter Maydell points out that the README misspells `Makefile' as
simon [Tue, 4 May 2004 08:33:28 +0000 (08:33 +0000)]
Peter Maydell points out that the README misspells `Makefile' as
`Makefile.gtk'.

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

20 years agoUninitialised variable caused ultra-wide windows. Silly.
simon [Tue, 4 May 2004 08:28:47 +0000 (08:28 +0000)]
Uninitialised variable caused ultra-wide windows. Silly.

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

20 years agoAdd a README.
simon [Mon, 3 May 2004 13:07:43 +0000 (13:07 +0000)]
Add a README.

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

20 years agoShell script to prepare a source distribution archive.
simon [Mon, 3 May 2004 13:03:12 +0000 (13:03 +0000)]
Shell script to prepare a source distribution archive.

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

20 years agoAdd a licence file.
simon [Mon, 3 May 2004 12:48:13 +0000 (12:48 +0000)]
Add a licence file.

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

20 years agoRedraws during undo in Sixteen had been broken by my faffing about
simon [Mon, 3 May 2004 12:12:30 +0000 (12:12 +0000)]
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.

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

20 years agoGTK and Windows appear to handle timers very differently:
simon [Mon, 3 May 2004 09:43:08 +0000 (09:43 +0000)]
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.

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

20 years agoMake Return and Escape work reliably in GTK dialog boxes.
simon [Mon, 3 May 2004 09:19:34 +0000 (09:19 +0000)]
Make Return and Escape work reliably in GTK dialog boxes.

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

20 years agoThe Windows RNG turns out to only give about 16 bits at a time. This
simon [Mon, 3 May 2004 09:10:52 +0000 (09:10 +0000)]
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!

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

20 years agoImplement selection of game seeds, by reusing the config box
simon [Mon, 3 May 2004 08:51:31 +0000 (08:51 +0000)]
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.

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

20 years ago`Fifteen' was getting the parity wrong on any size of board where
simon [Mon, 3 May 2004 07:56:23 +0000 (07:56 +0000)]
`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.

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

20 years agoGame configuration box for Windows, by constructing the dialog box
simon [Mon, 3 May 2004 07:52:33 +0000 (07:52 +0000)]
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.

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

20 years ago`BOOLEAN' is a term already used by Win32. Bah. Change terminology.
simon [Sun, 2 May 2004 10:43:46 +0000 (10:43 +0000)]
`BOOLEAN' is a term already used by Win32. Bah. Change terminology.

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

20 years agoConfiguration dialog box, on the GTK front end only as yet.
simon [Sat, 1 May 2004 11:32:12 +0000 (11:32 +0000)]
Configuration dialog box, on the GTK front end only as yet.

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

20 years agoRemove arbitrary restriction on Net minimum game size. (Awww, cute
simon [Sat, 1 May 2004 08:58:48 +0000 (08:58 +0000)]
Remove arbitrary restriction on Net minimum game size. (Awww, cute
2x2! Cuter 2x1!)

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