9 Commits

Author SHA1 Message Date
a7dc17c425 Rework the preset menu system to permit submenus.
To do this, I've completely replaced the API between mid-end and front
end, so any downstream front end maintainers will have to do some
rewriting of their own (sorry). I've done the necessary work in all
five of the front ends I keep in-tree here - Windows, GTK, OS X,
Javascript/Emscripten, and Java/NestedVM - and I've done it in various
different styles (as each front end found most convenient), so that
should provide a variety of sample code to show downstreams how, if
they should need it.

I've left in the old puzzle back-end API function to return a flat
list of presets, so for the moment, all the puzzle backends are
unchanged apart from an extra null pointer appearing in their
top-level game structure. In a future commit I'll actually use the new
feature in a puzzle; perhaps in the further future it might make sense
to migrate all the puzzles to the new API and stop providing back ends
with two alternative ways of doing things, but this seemed like enough
upheaval for one day.
2017-04-26 21:51:23 +01:00
fe11a86a7e Fix a failure to warn about non-unique rows/columns in non-square Unruly grids, reported in Debian bug #718354.
[originally from svn r9976]
2013-07-30 20:18:14 +00:00
e5df38fa15 Correct the comment at the top of unruly.c, which is out of date as of
r9837.

[originally from svn r9838]
[r9837 == 2f7831bb1626d82baff706e507d61a820ad84df1]
2013-05-05 22:27:20 +00:00
2f7831bb16 New configuration option in Unruly, to enable a mode in which no two
rows are permitted to have exactly the same pattern, and likewise
columns. (A row and a column can match, though.) This rule is
sometimes used, but not always; http://www.binarypuzzle.com/ in
particular has it (as a user just pointed out).

Since the filled-grid-generation stage of Unruly is implemented by
repeatedly choosing a square and then calling the solver to fill in
all its consequences, simply adding a solver mode conditional on this
flag is sufficient to do the whole of the interesting part of the job.

[originally from svn r9837]
2013-05-05 20:21:50 +00:00
251b21c418 Giant const patch of doom: add a 'const' to every parameter in every
puzzle backend function which ought to have it, and propagate those
consts through to per-puzzle subroutines as needed.

I've recently had to do that to a few specific parameters which were
being misused by particular puzzles (r9657, r9830), which suggests
that it's probably a good idea to do the whole lot pre-emptively
before the next such problem shows up.

[originally from svn r9832]
[r9657 == 3b250baa02a7332510685948bf17576c397b8ceb]
[r9830 == 0b93de904a98f119b1a95d3a53029f1ed4bfb9b3]
2013-04-13 10:37:32 +00:00
0b93de904a Add 'const' to the game_params arguments in validate_desc and
new_desc. Oddities in the 'make test' output brought to my attention
that a few puzzles have been modifying their input game_params for
various reasons; they shouldn't do that, because that's the
game_params held permanently by the midend and it will affect
subsequent game generations if they modify it. So now those arguments
are const, and all the games which previously modified their
game_params now take a copy and modify that instead.

[originally from svn r9830]
2013-04-12 17:11:49 +00:00
9dcba6a8cf Make Unruly's keyboard controls match the documentation and other puzzles in
the collection -- now Enter = black and Space = white.

[originally from svn r9770]
2013-03-10 12:49:06 +00:00
8dddfc22d7 Remove an unused variable spotted by gcc 4.6.3.
[originally from svn r9682]
2012-10-07 15:41:44 +00:00
fc9e6277bd New puzzle! 'Unruly', contributed by Lennard Sprong, is an
implementation of a puzzle usually called 'Tohu wa Vohu'.

[originally from svn r9680]
2012-10-07 10:18:33 +00:00