aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
...
* Don't try to run solver_killer_sums on a Killer cage with only oneSimon Tatham2012-02-02
| | | | | | | | | | square. It isn't equipped for it, and will try to handle it with the 4-square case and get confused. This can come up if the DIFF_KINTERSECT pass before that split a cage, and will cause the solver to miss valid solutions; e.g. 3x3kadu#802065940985372 would generate an ambiguous puzzle before this change. [originally from svn r9402]
* Fix a couple of typos in messages.Simon Tatham2012-02-02
| | | | [originally from svn r9401]
* David Nickerson reports that it's possible to lay a line over a 'noSimon Tatham2012-02-02
| | | | | | | | | | line here' cross mark by dragging, and furthermore, that doing so puts that grid edge into a stuck state that no UI action short of undo can get it back out of. Fix drags to stop at crosses, and fix execute_move to fault any move string that nonetheless somehow managed to try to set a line over a cross without explicitly tagging it 'R'. [originally from svn r9400]
* Sort out a bit of confusion between mouse- and keyboard-driven dragsSimon Tatham2012-01-31
| | | | | | | | | | | in Rectangles. Mouse drags now take priority - you can't start a keyboard drag while the mouse is held down, and starting a mouse drag instantly cancels an unfinished keyboard drag - and also I've fixed an assertion failure which would come up if you had the keyboard cursor visible at the end of a mouse drag (by pressing arrow keys while the mouse was held down). [originally from svn r9393]
* Move a debug statement at the end of new_clues from the caller (justSimon Tatham2012-01-31
| | | | | | | | | | after return) to the callee (just before). Might print something useful in the soak-test context (where that debug statement will now be printed and previously wasn't), but the main aim is to remove the variable 'ngen' at the main call site, which triggered a set-but-not- used warning if the debug statement that printed it was compiled out. [originally from svn r9392]
* Add comments suggesting some solver upgrades to Light Up (perhaps forSimon Tatham2012-01-23
| | | | | | | | | | a new sub-recursive difficulty level?), inspired by a user emailing in the game ID 18x10:gBc1b2g2e2d1b2c2h2e3c2dBd1g1bBb2b1fBbBb1bBgBd2dBi1h1c2b1dBe2bBdBb3cBg which I was able to solve without backtracking by the use of these techniques. [originally from svn r9388]
* The Light Up solver limits its recursion depth, so if it fails to findSimon Tatham2012-01-23
| | | | | | | a solution then it should not deduce that no solution exists. Change wording of the error message returned from the Solve user action. [originally from svn r9387]
* Fix default parameter assignment in Light Up when validating anSimon Tatham2012-01-23
| | | | | | | | incomplete parameter string: if the user hand-types a game ID along the lines of '18x10:stuff', we should not assume SYMM_ROT4 in the resulting game_params, since it'll be failed by validate_params. [originally from svn r9386]
* Trivial and silly patch to allow users to configure the SignpostSimon Tatham2012-01-22
| | | | | | | | victory roll so that adjacent arrows rotate in opposite directions, giving the impression that they're an interlocking field of gears. Possibly even more brain-twisting than the original version :-) [originally from svn r9384]
* It's a new year.Jacob Nevins2012-01-22
| | | | | | (It was a new year this time last year, too.) [originally from svn r9382]
* Tweak right-click processing to be less finicky.Simon Tatham2012-01-22
| | | | [originally from svn r9381]
* New puzzle! Or rather, new-ish, because this one has been lying aroundSimon Tatham2012-01-22
| | | | | | | | | | | | | in the 'unfinished' directory for a while, and has now been finished up thanks to James Harvey putting in some effort and galvanising me to put in the rest. This is 'Pearl', an implementation of Nikoli's 'Masyu'. The code in Loopy that generates a random loop along grid edges to use as the puzzle solution has been abstracted out into loopgen.[ch] so that Pearl can use it for its puzzle solutions too. I've also introduced a new utility module called 'tdq' (for 'to-do queue'). [originally from svn r9379]
* Fix a bug causing premature defeatism in the Bridges solver. DeducingSimon Tatham2012-01-17
| | | | | | | | | | | a better upper bound on the number of bridges leaving a given island in a given direction was not counted as having 'done something'; so a solver run could make several such deductions, but then terminate in the belief that it hadn't achieved anything, when just going back round the main solver loop would have enabled it to make further deductions based on those new bounds. [originally from svn r9377]
* Allow --save to work with --soln, causing saved game files to beSimon Tatham2011-12-28
| | | | | | written out with the Solve operation having already been performed. [originally from svn r9375]
* Fix bug in error reporting for --save caused by freeing 'realname'Simon Tatham2011-12-28
| | | | | | before the error messages wanted to use it. [originally from svn r9374]
* Fix bug in --save caused by failure to initialise ctx.error to zeroSimon Tatham2011-12-28
| | | | | | before later checking to see if an errno code was dumped in it. [originally from svn r9373]
* In Group, the keyboard-controlled cursor should respect userSimon Tatham2011-12-21
| | | | | | rearrangement of the rows and columns. [originally from svn r9372]
* Remove the 'cheated' flag in Range's game_ui, which was stickilySimon Tatham2011-09-18
| | | | | | | | | | | | | | | | | | | | remembering whether the player had ever used the hint or solve functions, even if they then pressed undo (and even if they saved and restored). As far as Solve+Undo is concerned, this just brings Range into line with common practice in the rest of my puzzles. On the other hand, Range is the first time there's been a 'hint' function to consider in this question, so here's a policy decision: the victory flash is not a congratulation for a puzzle solved unaided, it's a confirmation that you really have reached a correct solution and haven't made any mistakes. So the only reason to omit the victory flash is if you've used the Solve operation to go straight to a guaranteed-correct solution _in a single move_; if you're using the hint button, there's still scope for you to make mistakes in all your non-hint moves, so the victory flash is still a useful indicator that you didn't. [originally from svn r9306]
* When we run out of background colours for chains and wrap back to theSimon Tatham2011-09-18
| | | | | | | | beginning, we should wrap back to COL_B0+1 rather than COL_B0 itself, so as not to reuse white. White should be special, and always indicate a properly numbered square. [originally from svn r9305]
* Patch from Chris Boyle to fix Signpost's labelling when you have moreSimon Tatham2011-09-18
| | | | | | | | than 26 separate linked chains of unnumbered squares: we now wrap from 'z' to an Excel-like 'aa', 'ab', ..., instead of falling off z into punctuation and control characters. [originally from svn r9304]
* 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 segfault in Loopy printing, introduced when I added the dynamicSimon Tatham2011-05-11
| | | | | | | | arrays 'textx' and 'texty' to the game_drawstate but failed to initialise them in the temporary drawstate used by game_print(). Thanks to Arun Giridhar for spotting this. [originally from svn r9173]
* Having played Keen a bit following the clue-generation fix in r9165,Simon Tatham2011-05-07
| | | | | | | | | | | | | | | | | I've decided that the extremely low density of one-option multiplication clues is not a universally good idea after all: it seems to me to make puzzles _quantitatively_ harder, even if Keen's difficulty-level system can't see any difference in the set of modes of reasoning required at least once to solve the grid. So I've readjusted the clue selection, so that multiplicative clues with only one workable pair of factors are restored to 'good' status at Normal difficulty level and below, and only considered less-than- fully-desirable at Hard and above. I think that's a reasonable compromise. [originally from svn r9170] [r9165 == e7b2a9dd8d8915802fb69ce2242b1f913b7f3172]
* Apply the rotation in Penrose grid descriptions by rotating in theSimon Tatham2011-05-06
| | | | | | | | | | | | | | | | | | | | 4-vector representation, rather than mucking about with sines and cosines after grid generation. _Should_ make no difference in the generated grids (there's a theoretical risk of an unlucky rounding error just about managing to push some point in or out of bounds, but I think it's vanishingly small), but simplifies the coordinate- flattening procedure, and in particular increases its chance of getting vertical lines actually vertical. (Prior to this change, the game ID 10x10t12:G2554,-31,108_a3b12h0a212a3d102b2a23a2e3b01b0a2c2a0c0 was generating a not-quite-vertical edge at top left, in the Java port but not on Linux; I suspect differences in sin and cos as the cause of the discrepancy. With the rotation done like this, the points' x-coordinates are now computed without reference to their y-coordinates.) [originally from svn r9168]
* Apply a missing bit of r9164, which only broke the build withSimon Tatham2011-05-05
| | | | | | | -DDEBUGGING so I didn't notice it at the time. [originally from svn r9167] [r9164 == 2efc77d2fde7e53604f8490b57f18a36eec5c4fb]
* Portability fixes, mostly from James for Palm purposes. MostlySimon Tatham2011-05-04
| | | | | | | | additions of missing 'static' and explicit 'void' in parameter lists, plus one or two other things like explicitly casting chars in variadic argument lists to int and using DBL_MAX if HUGE_VAL isn't available. [originally from svn r9166]
* Having looked at Keen's clue selection code, I also notice that theSimon Tatham2011-05-04
| | | | | | | | | | intended behaviour of classifying multiplication clues as low-quality if they only left one possible pair of multiplicands has never actually worked, because I should have compared the possible clue count against 2 rather than 1 since the multiplicands can occur either way round. [originally from svn r9165]
* 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]
* Fix two memory leaks reported by Tiago Dionizio in recent LoopySimon Tatham2011-04-26
| | | | | | development. [originally from svn r9163]
* Forgot to set 'has_incentre' on triangular grids, which don't useSimon Tatham2011-04-25
| | | | | | grid_face_add_new(). Oops. [originally from svn r9161]
* From James Harvey (via a period of collaborative polishing), a patchSimon Tatham2011-04-24
| | | | | | | | | | | | | | | | | | to add two kinds of Penrose tiling to the grid types supported by Loopy. This has involved a certain amount of infrastructure work, because of course the whole point of Penrose tilings is that they don't have to be the same every time: so now grid.c has grown the capacity to describe its grids as strings, and reconstitute them from those string descriptions. Hence a Penrose Loopy game description consists of a string identifying a particular piece of Penrose tiling, followed by the normal Loopy clue encoding. All the existing grid types decline to provide a grid description string, so their Loopy game descriptions have not changed encoding. [originally from svn r9159]
* Oops: initialise that new 'has_incentre' flag to false, otherwise theSimon Tatham2011-04-23
| | | | | | | game will sometimes pick random incentres in place of the carefully computed ones. Ahem. [originally from svn r9158]
* Move most of face_text_pos() into grid.c, leaving in loopy.c only theSimon Tatham2011-04-23
| | | | | | | | | | part that converts from abstract grid coordinates into screen coordinates. This should speed up window-resizing by eliminating pointless reiteration of the complicated part of the algorithm: now when a game_drawstate is renewed, only the conversion into screen coordinates has to be redone. [originally from svn r9157]
* Replace my brute-force algorithm in face_text_pos with a more complexSimon Tatham2011-04-23
| | | | | | but faster and more mathematically sensible one. [originally from svn r9156]
* Stop calling face_text_pos() for faces that don't need to have text inSimon Tatham2011-04-23
| | | | | | them anyway. It's slow and pointless. [originally from svn r9155]
* Support user-specified extra link flags (XLFLAGS) in the UnixSimon Tatham2011-04-23
| | | | | | makefile. Makes it easy to recompile for things like profiling. [originally from svn r9154]
* Fix mismatch between printf format strings and arguments in someSimon Tatham2011-04-11
| | | | | | | | | | | solosolver verbose diagnostics in X mode. Also added gcc-specific prototypes with __attribute__((format)) to ensure they all get checked in future. Spotted by Arun Giridhar; segfault without this fix is reproducible by 'solosolver -v 3x3x:7_9e4_1c7d3e3d1b2_4e2c6e5_6b1d8e5d9c8_2e9_5'. [originally from svn r9151]
* Remove a stray diagnostic.Simon Tatham2011-04-05
| | | | [originally from svn r9147]
* Fix an amusing cut-and-paste error in the Java drawing code which wasSimon Tatham2011-04-05
| | | | | | | causing complete mis-draws - but only when the window was exactly the right size! [originally from svn r9146]
* Adjust the yellow used for LINE_UNKNOWN so that it's always a bitSimon Tatham2011-04-05
| | | | | | | darker than the background, because the Java front end demonstrates that it's a bit eyewatering when it _matches_ the background. [originally from svn r9145]
* Trivial markup fix.Simon Tatham2011-04-03
| | | | [originally from svn r9144]
* Add a new deduction to Easy level, which is as small as I can make itSimon Tatham2011-04-03
| | | | | | | | | | to have the effect of enabling large Easy-level grids to be constructed in all grid types. Without this, some generations at Easy level (e.g. 'loopy --generate 1 7x7t9de') can spin forever because _even with all clues filled in_ the generated grids can't be solved at that level. [originally from svn r9143]
* Move up midend_is_solved() in the developer docs from subheading toSimon Tatham2011-04-03
| | | | | | | | heading level. It's _almost_ apt to have it as a subheading of midend_solve(), but not quite, and it certainly wasn't intentional - I must have absentmindedly typed the wrong Halibut command letter. [originally from svn r9142]
* 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]
* Add functions provided by the midend to tell a front end whether GUISimon Tatham2011-04-02
| | | | | | buttons for undo and redo should currently be greyed out. [originally from svn r9139]
* Rework the Loopy grid drawing algorithm so that it doesn't assume whenSimon Tatham2011-04-02
| | | | | | | | | | | | | | | | it clears a clipping region that it knows what features will need redrawing in that region. Instead, I've moved all the clip/unclip/draw functionality out into a game_redraw_in_rect() function which checks _everything_ on the grid to see if it lies in the region. As far as I can tell the effect only shows up in grid types that aren't checked in, but it makes the code look nicer too. (It would be nicer still to avoid the brute-force loop over the whole grid checking it against the bounding box, particularly when we're drawing in multiple bounding boxes. But this will do for the moment.) [originally from svn r9138]
* Improve the algorithm for figuring out where the number should beSimon Tatham2011-04-02
| | | | | | | | | | | | drawn in a face: averaging the vertex positions works fine for regular or roughly regular convex polygons, but it'll start being a pain for odder or concave ones. This is a kludgey brute-force algorithm; I have ideas about more elegant ways of doing this job, but they're more fiddly, so I thought I'd start with something that basically worked. [originally from svn r9137]
* When a lot of edges meet the same point - and, in particular, whenSimon Tatham2011-04-02
| | | | | | | | | | they meet at sharp enough angles that the thick lines overlap noticeably outside the circle of the point - redrawing the edges in a different order each time looks ugly. Arrange to always redraw edges in order of colour, so that empty lines are drawn before indeterminate lines which in turn come before filled-in lines. [originally from svn r9136]
* Another patch from Chris Moore implementing two more grid types, bothSimon Tatham2011-02-24
| | | | | | involving dodecagons. [originally from svn r9109]