aboutsummaryrefslogtreecommitdiff
path: root/unequal.c (follow)
Commit message (Collapse)AuthorAge
* New rule: interpret_move() is passed a pointer to the game_drawstateSimon Tatham2012-09-09
| | | | | | | | | | | | | | | | basically just so that it can divide mouse coordinates by the tile size, but is definitely not expected to _write_ to it, and it hadn't previously occurred to me that anyone might try. Therefore, interpret_move() now gets a pointer to a _const_ game_drawstate instead of a writable one. All existing puzzles cope fine with this API change (as long as the new const qualifier is also added to a couple of subfunctions to which interpret_move delegates work), except for the just-committed Undead, which somehow had ds->ascii and ui->ascii the wrong way round but is otherwise unproblematic. [originally from svn r9657]
* Changed my mind about midend_is_solved: I've now reprototyped it asSimon Tatham2011-06-19
| | | | | | | | | | | | | | | | midend_status(), and given it three return codes for win, (permanent) loss and game-still-in-play. Depending on what the front end wants to use it for, it may find any or all of these three states worth distinguishing from each other. (I suppose a further enhancement might be to add _non_-permanent loss as a fourth distinct status, to describe situations in which you can't play further without pressing Undo but doing so is not completely pointless. That might reasonably include dead-end situations in Same Game and Pegs, and blown-self-up situations in Mines and Inertia. However, I haven't done this at present.) [originally from svn r9179]
* Pass background colour as a parameter to draw_gts and draw_adjs, soSimon Tatham2011-05-22
| | | | | | | | | that we can pass -1 in calls from game_print(). Fixes a printing bug in which all the adjs and gts were overlaid with giant black rectangles! (Because COL_BACKGROUND doesn't mean the same thing in that context.) [originally from svn r9175]
* Fix warnings generated by gcc 4.6.0 about variables set but notSimon Tatham2011-05-04
| | | | | | | | | | thereafter read. Most of these changes are just removal of pointless stuff or trivial reorganisations; one change is actually substantive, and fixes a bug in Keen's clue selection (the variable 'bad' was unreferenced not because I shouldn't have set it, but because I _should_ have referenced it!). [originally from svn r9164]
* Add a function to every game backend which indicates whether a gameSimon Tatham2011-04-02
| | | | | | | | | | | state is in a solved position, and a midend function wrapping it. (Or, at least, a situation in which further play is pointless. The point is, given that game state, would it be a good idea for a front end that does that sort of thing to proactively provide the option to start a fresh game?) [originally from svn r9140]
* Patch from Mark Wooding to add antialiasing-safety in repeatedSimon Tatham2010-05-29
| | | | | | | redrawing of inequality signs in Unequal (which are redrawn when they change colour). [originally from svn r8964]
* Chris Boyle reports an off-by-two error ('a Qui-Gon Jinx' :-) inSimon Tatham2010-03-21
| | | | | | | difficulty selection in Unequal's solver. I suspect I missed this when I refactored latin.c and its callers. [originally from svn r8906]
* Fix from James H: the shared code between drawing and printingSimon Tatham2010-01-18
| | | | | | | should use state->adjacent rather than ds->adjacent, because the latter won't be initialised in printing mode. [originally from svn r8852]
* A user asked for the < signs in Unequal to be bolder.Simon Tatham2010-01-05
| | | | [originally from svn r8808]
* Fix bug causing array overrun. Only seemed to be showing a symptomSimon Tatham2009-12-27
| | | | | | | on Windows, presumably because the data after the array was harmless elsewhere. [originally from svn r8798]
* Normalise Unequal (and latin.c) so that solver diagnostics startSimon Tatham2009-12-27
| | | | | | | | their coordinate from 1 rather than 0, for consistency with Solo. (My geek instincts would rather work from 0, but I've generally found that puzzle users sending me email tend to prefer 1.) [originally from svn r8795]
* Refactor latin.c to make it easier to reuse. Instead of clientSimon Tatham2009-12-27
| | | | | | | | | | | programs having to clone the latin_solver() function and insert their own extra deduction routines, they can now just _call_ latin_solver with enough parameters to let it fit its own deductions into their difficulty framework and call a set of provided function pointers to do user deductions. Modified Unequal to work in the new world, of course. [originally from svn r8791]
* New mode for Unequal, from James H. In this mode, called 'Adjacent',Simon Tatham2009-12-27
| | | | | | | | | | the < and > clues are replaced by bars separating every pair of squares whose contents differ by exactly 1. Unlike standard Unequal, which presents only a subset of the available clues, in Adjacent the clues are _all_ present, so you can deduce from the absence of a bar that the two numbers it would separate are _not_ consecutive. [originally from svn r8790]
* Jonas Koelker points out that the backspace key didn't work in GTKSimon Tatham2009-12-20
| | | | | | | | | | Guess, because Guess expected ^H whereas GTK generated ^?. Other puzzles that use Backspace do it by being prepared to see either, which seems wasteful. Now the midend normalises both into ^H, so front ends can generate whichever they like while puzzles can safely just look for ^H. [originally from svn r8786]
* Reorder if statements in Unequal's interpret_move() so that pressesSimon Tatham2009-01-26
| | | | | | | | | | | | | | | | | of 'h' and 'm' are treated as digits if a square is selected, and only treated as special commands otherwise. This renders very large games (just about) playable. Idea from Ben Hutchings's collection of Debian patches, although I had to redo his (trivial) patch myself since the code has changed recently. (Addendum after committing: hmm, I see Jacob already applied the original version of the patch a while back. Looks as if the recent keyboard control change reintroduced the problem. Still, re-fixed now.) [originally from svn r8433]
* Patch from James H which adds keyboard cursor support to Unequal,Simon Tatham2009-01-12
| | | | | | | | and also updates the docs for both that and the Mines cursor support in r8402. [originally from svn r8408] [r8402 == f20847354cb6335fd349204f16021a72e2956cce]
* Apply "103_fix-unequal-digit-h.diff" from the Debian package:Jacob Nevins2008-10-05
| | | | | | | | Unequal 18x18 or above was unplayable due to a clash with the undocumented "H" (hint) key. Resolve the clash by making the hint function only fire when no square is selected. [originally from svn r8200]
* New infrastructure feature. Games are now permitted to beSimon Tatham2008-09-06
| | | | | | | | | | | | | | | | | | | | | | _conditionally_ able to format the current puzzle as text to be sent to the clipboard. For instance, if a game were to support playing on a square grid and on other kinds of grid such as hexagonal, then it might reasonably feel that only the former could be sensibly rendered in ASCII art; so it can now arrange for the "Copy" menu item to be greyed out depending on the game_params. To do this I've introduced a new backend function (can_format_as_text_now()), and renamed the existing static backend field "can_format_as_text" to "can_format_as_text_ever". The latter will cause compile errors for anyone maintaining a third-party front end; if any such person is reading this, I apologise to them for the inconvenience, but I did do it deliberately so that they'd know to update their front end. As yet, no checked-in game actually uses this feature; all current games can still either copy always or copy never. [originally from svn r8161]
* Disallow clicks between squares.Jacob Nevins2007-03-16
| | | | [originally from svn r7400]
* Minor cleanups (mostly \ns in diagnostic printfs) from James H.Simon Tatham2007-03-03
| | | | [originally from svn r7363]
* General cleanups patch from James H:Simon Tatham2007-02-28
| | | | | | | | | | | | - missing static in filling.c - better robustness in execute_move() in filling.c - remove side effects in assert statements - remove rogue diagnostic in galaxies.c - remove // comment in map.c - add more stylus-friendly UI to Pattern - bias Unequal towards generating inequality clues rather than numeric [originally from svn r7344]
* Dariusz Olszewski's changes to support compiling for PocketPC. ThisSimon Tatham2007-02-26
| | | | | | | | | | | | is mostly done with ifdefs in windows.c; so mkfiles.pl generates a new makefile (Makefile.wce) and Recipe enables it, but it's hardly any different from Makefile.vc apart from a few definitions at the top of the files. Currently the PocketPC build is not enabled in the build script, but with any luck I'll be able to do so reasonably soon. [originally from svn r7337]
* Patch from James H to fix the occasional generation of puzzlesSimon Tatham2007-01-15
| | | | | | harder than requested. [originally from svn r7113]
* Add James H's new puzzle, `Unequal' (otherwise known as theSimon Tatham2007-01-13
Guardian's `Futoshiki'). [originally from svn r7100]