aboutsummaryrefslogtreecommitdiff
path: root/filling.c (follow)
Commit message (Collapse)AuthorAge
* Fix array overruns in the new Filling solver pass.Simon Tatham2015-10-21
| | | | | | | | | | | | | Probably because I wrote a couple of loops up to the maximum cell value using the non-idiomatic <= for their termination test, I also managed to use <= inappropriately for iterating over every cell of the grid, leading to a couple of references just off the end of arrays. Amusingly, it was the Emscripten front end which pointed this out to me by actually crashing as a result! Though valgrind found it just fine too, once I thought to run that. But it comes to something when running your C program in Javascript detects your memory errors :-)
* Enhance Filling's solver to handle large ghost regions.Simon Tatham2015-10-20
| | | | | | | | | | | | | | | | The previous solver could cope with inferring a '1' in an empty square, but had no deductions that would enable it to infer the existence of a '4'-sized region in 5x3:52d5b1a5b3. The new solver can handle that, and I've made a companion change to the clue-stripping code so that it aims to erase whole regions where possible so as to actually present this situation to the player. Current testing suggests that at the smallest preset a nontrivial ghost region comes up in about 1/3 of games, and at the largest, more like 1/2 of games. I may yet decide to introduce a difficulty level at which it's skewed to happen more often still and one at which it doesn't happen at all; but for the moment, this at least gets the basic functionality into the code.
* Produce shorter Filling descriptions by run-length encoding 0s.Jonas Kölker2015-10-18
|
* Render Filling presets as 'WxH', not 'HxW'.Jonas Kölker2015-10-03
|
* Greatly improve and speed up the Filling instance generation.Jonas Kölker2015-10-03
|
* Greatly increase the speed of the Filling solver.Jonas Kölker2015-10-03
|
* Filling: enable keyboard-driven cursor dragging mode.Jonas Kölker2015-10-03
|
* Giant const patch of doom: add a 'const' to every parameter in everySimon Tatham2013-04-13
| | | | | | | | | | | | | | 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]
* Fix a memory management bug in Filling: in some situations itsSimon Tatham2013-04-13
| | | | | | | | solve_game() was returning its aux parameter un-dupstr()ed, which is wrong. Also clarified the developer docs on that function to make it clearer that the returned string should be dynamic. [originally from svn r9831]
* Add 'const' to the game_params arguments in validate_desc andSimon Tatham2013-04-12
| | | | | | | | | | | | 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]
* 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]
* Patch from Jonas Koelker to improve Filling's error highlighting: asSimon Tatham2012-05-14
| | | | | | | | | well as marking a region as wrong if it has too many squares for the number written in it, this patch now causes a region to be marked wrong if it has too few squares _and no liberties_, so that it can't just be one the user is intending to enlarge later. [originally from svn r9534]
* 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]
* 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]
* Fix incorrect uses of ctype.h (passing it uncast chars, or otherSimon Tatham2010-04-17
| | | | | | things potentially not in the range 0..255). [originally from svn r8922]
* 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]
* More defensive-coding fixes from James H.Simon Tatham2009-07-01
| | | | [originally from svn r8605]
* Memory management and other fixes from James H.Simon Tatham2009-06-17
| | | | [originally from svn r8596]
* Keyboard interface for Filling, from James H.Simon Tatham2009-01-14
| | | | [originally from svn r8412]
* 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]
* UI change to Filling: allow multiple squares to be set at once.Jacob Nevins2008-02-10
| | | | | | | | | (This change adds a new possibility to the save format, such that new save files won't necessarily be loadable by old binaries. I think that's acceptable -- it's certainly happened before -- but I couldn't find anything in the developer docs explicitly blessing it.) [originally from svn r7849]
* Updates and improvements from Jonas Koelker.Simon Tatham2007-05-20
| | | | [originally from svn r7601]
* Bound edge thicknesses below so that they're always thicker than theSimon Tatham2007-03-01
| | | | | | grid lines. [originally from svn r7349]
* Fix some border drawing issues.Jacob Nevins2007-02-28
| | | | [originally from svn r7347]
* 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]
* This game requires the numpad.Simon Tatham2007-02-27
| | | | [originally from svn r7338]
* 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]
* Hardwiring the grid line width to 1 is really bad for printing. UseSimon Tatham2007-02-25
| | | | | | | a slightly more conventional method of drawing the grid lines, and thereby fix printing. [originally from svn r7335]
* Don't create an undo-chain entry for a move with no effect.Simon Tatham2007-02-25
| | | | [originally from svn r7333]
* New puzzle: `Filling', a Fillomino implementation by Jonas Koelker.Simon Tatham2007-02-25
[originally from svn r7326]