125 Commits

Author SHA1 Message Date
865e8ad6ca 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.)

[originally from svn r5844]
2005-05-26 13:40:38 +00:00
a1be37343c 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.

[originally from svn r5842]
2005-05-25 11:09:43 +00:00
1304e07d74 Standalone solvers were broken by my recent API changes.
[originally from svn r5800]
2005-05-18 08:34:01 +00:00
2534ec5d69 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.

[originally from svn r5788]
2005-05-16 18:57:09 +00:00
68d27f0526 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!).

[originally from svn r5774]
2005-05-12 18:25:57 +00:00
6336dbf208 Add 3x3 Trivial to the presets list, and make it the default.
[originally from svn r5757]
2005-05-07 12:35:04 +00:00
944997d2f9 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'!

[originally from svn r5756]
2005-05-07 12:30:29 +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
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
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
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
d55d0b53f3 Correct block coordinate display when standalone solver shows its
working.

[originally from svn r5706]
2005-04-29 08:11:01 +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
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
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
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