aa08d80a5fAlways something. Mention `svn add'ing the .R file in the new-puzzle checklist, and mention the now-not-version-controlled list.c in svn:ignore.
Simon Tatham
2006-08-05 17:25:09 +00:00
cf880225edI'm sick of repeatedly adding and removing local changes to Recipe when testing a new game, so here's a new architecture for the Recipe file. mkfiles.pl now supports several new features:
Simon Tatham
2006-08-05 17:20:29 +00:00
f05c25347dExtra utility function.
Simon Tatham
2006-08-05 16:35:25 +00:00
cfcd8cf8c5Since r6711, puzzles built with Gtk 1.2 would take double actions when a menu accelerator key (N/U/R/Q) was pressed -- once for the menu accelerator, and once more in key_event(). This workaround, while unlovely, should at least not break in future (since the things it relies on are unlikely to change).
Jacob Nevins
2006-06-26 22:01:51 +00:00
d952a3b6ffTrivial patch from Ben Hutchings to support resizable windows under GTK. All the infrastructure in the midend and beyond was already there; it was just a matter of enabling it!
Simon Tatham
2006-05-20 12:06:41 +00:00
077aa510c7Ben Hutchings's patch to add display of key accelerators in the Game menu.
Simon Tatham
2006-05-20 12:01:55 +00:00
fd90d1a7c8Patch from Ben Hutchings to prevent an ugly special case in &splitline in which a line is `split' into a line ending in a backslash followed by a completely blank line.
Simon Tatham
2006-05-20 11:58:24 +00:00
197e262ba6Cleanup patch from Ben Hutchings, fixing some odd-looking range checks. He thinks they were harmless (due to being followed by other range checks in RIGHTOF_DOT and friends) but it clearly can't hurt to fix them anyway.
Simon Tatham
2006-05-20 11:54:21 +00:00
877900f58aPatch from Ben Hutchings to prevent memory leakage during Loopy game generation.
Simon Tatham
2006-05-20 11:52:22 +00:00
3575c3df79Tidy up comments.
Simon Tatham
2006-03-12 09:06:27 +00:00
27160f7ad2Introduce a new deductive mode in Slant's Hard level, which is the generalisation of the previous deduction involving two 3s or two 1s either adjacent or separated by a row of contiguous 2s. I always said that was an ugly loop and really ought to arise naturally as a special case of something more believable, and here it is.
Simon Tatham
2006-03-06 20:03:27 +00:00
87eaeb51fe"Hold" function in Guess was completely broken. Fix it, add holds to the undo history (by analogy with Net), and save the current holds in saved games. Also fix a couple of unrelated minor issues with string encoding.
Jacob Nevins
2006-03-03 20:04:13 +00:00
a8fd3a1b17I've been pondering whether to do this for months: turn the rather washed-out yellow and green in Guess into their full-brightness pure forms. This makes them hard to see against some backgrounds, so I'm also surrounding all coloured pegs with black outlines. Looks a little cartoony, but I think it's an overall improvement on the previous look.
Simon Tatham
2006-03-02 19:39:46 +00:00
fe514e9374Mines's error signalling is highly asymmetric: if you erroneously believe a square to be empty, you find out instantly and lethally, but if you erroneously believe a square to be full you can occasionally (when it doesn't cause a complementary square to be assumed empty) not notice until you find at the very end of the game that you're one mine heavy. To help with this, here's an error highlighting patch: any number square surrounded by an excess of flags will now light up red. This should be an unintrusive change, because it will never happen unless you make a mistake.
Simon Tatham
2006-02-20 19:51:50 +00:00
afe3a1372aSmall docs patch from Phil Bordelon adding more history of Sudoku.
Simon Tatham
2006-02-19 12:54:17 +00:00
9a59d8a45aPatch from Phil Bordelon to improve Bridges' appearance by adjusting the font size.
Simon Tatham
2006-02-19 12:42:46 +00:00
c5001ca751Tal Kelrich spotted that hitting `Solve' on a configuration which is laser-indistinguishable from the right solution _but_ has a number of balls outside the acceptable range does not report an error. His example was the game ID w8h8m5M5:1e3e6e80fa3e16265ccef7ca , omitting the rightmost ball in the second row.
Simon Tatham
2006-02-07 21:45:50 +00:00
acafc4d93fIt's a new year.
Jacob Nevins
2006-01-08 18:18:11 +00:00
ac027d9d08Revert a change in an assertion made in r6299. It was right the first time, and now has a comment explaining why!
Simon Tatham
2006-01-05 09:40:51 +00:00
7c5ff85bb1Add some random index terms. ("Sudoku" wasn't in the index!)
Jacob Nevins
2005-12-27 15:36:21 +00:00
e15a2defffLaurent Thioudellet reports that gcc4's ultra-cautious data flow warnings require two more variables to be explicitly initialised. In fact these variables are reliably initialised by a subfunction; gcc3 was happy to assume I knew what I was doing when it couldn't prove they were definitely used uninitialised, whereas gcc4 apparently takes the view that the onus is on me to allow it to prove they _aren't_. I regard this as a step backwards, since the effect will be to make explicit initialisation commonplace in cases where the initialiser value is chosen arbitrarily and never expected to be used, at which point (a) it will be less clear which initialisers have genuine purpose and which are compiler-placating fluff, and (b) valgrind's run-time uninitialised-data tracking will become less useful. Still, the effect doesn't seem great as yet, so here's the gcc4-placating checkin.
Simon Tatham
2005-12-26 23:24:09 +00:00
74f45138aeI've just noticed a bug in the Inertia solver: if you call it on an already-solved grid (i.e. no gems), it will still attempt to show you a move you can make. Eliminate that special case.
Simon Tatham
2005-12-26 11:26:34 +00:00
f0ec00fb4cCorrect w/h mixup in grid edge checks.
Simon Tatham
2005-11-10 11:57:15 +00:00
c8855bff31Document Unix command-line options.
Jacob Nevins
2005-10-22 19:58:59 +00:00
5e28f1a971Fix segfault in Tents' printing.
Jacob Nevins
2005-10-22 18:18:21 +00:00
cc6092ce79Work around a couple of minor display issues with max bridges set to 4:
Jacob Nevins
2005-10-22 18:07:56 +00:00
240b6cab8cCleanup: relieve frontends of the duty to call midend_rewrite_statusbar() and check the result against the last string returned. This is now done centrally in drawing.c, and the front end status bar function need only do what it says on the tin.
Simon Tatham
2005-10-22 17:23:55 +00:00
a3b837c698Cleanup: remove the `just_used_solve' field from a number of games which didn't actually need it. It was originally introduced in Fifteen to suppress animation on Solve moves, but midend.c now does that centrally unless the game specifically instructs it otherwise. Therefore, just_used_solve is obsolete in all games which previously used it. (Mines was even worse: it scrupulously maintained the correctness of the field but never used it!)
Simon Tatham
2005-10-22 17:00:35 +00:00
d31f3ac3a5Forgot to update devel.but in r6417.
Simon Tatham
2005-10-22 16:53:06 +00:00
eb2013efc0Cleanup: it was absolutely stupid for game_wants_statusbar() to be a function, since it took no parameters by which to vary its decision, and in any case it's hard to imagine a game which only _conditionally_ wants a status bar. Changed it into a boolean data field in the backend structure.
Simon Tatham
2005-10-22 16:52:16 +00:00
40fcf516f4Cleanup: remove the game_state parameter to game_colours(). No game was actually using it, and also it wasn't being called again for different game states or different game parameters, so it would have been a mistake to depend on anything in that game state. Games are now expected to commit in advance to a single fixed list of all the colours they will ever need, which was the case in practice already and simplifies any later port to a colour-poor platform. Also this change has removed a lot of unnecessary faff from midend_colours().
Simon Tatham
2005-10-22 16:44:38 +00:00
b44d75aa4eNoticed recently that bitcount16() isn't 16-bit clean due to signed shift right. It doesn't actually matter in the current code since the input word only ever uses the bottom 9 bits, but if I ever extended Mines to work in a triangular grid then all 16 bits might be required. Fix this now, while I'm cleaning things up, so that it won't bite me unexpectedly in future.
Simon Tatham
2005-10-22 16:38:15 +00:00
b7f192eea3Cleanup: the mouse_priorities' field in the back end has been a more general-purpose flags word for some time now. Rename it to flags'.
Simon Tatham
2005-10-22 16:35:23 +00:00
6824dcde03OS X frontend was directly calling the backend's wants_statusbar() function, whereas it ought to have been calling the midend's one.
Simon Tatham
2005-10-22 16:34:28 +00:00
23ab000b7bCleanup: rename random_init() to random_new(), because it actually _allocates_ a random_state rather than just initialising one passed in by the caller.
Simon Tatham
2005-10-22 16:27:54 +00:00
4faecc7726New puzzle from James H: `Bridges', another Nikoli job.
Simon Tatham
2005-10-21 08:07:31 +00:00
6ea453c95fMiscellaneous fixes. Correct a comparison of y with w causing assertion failures in portrait-type grids; retire an unused array in the game generation function (my original generation strategy needed it, but the final one didn't); correct a typo; further restrict the generable sizes of game and include a special case for 4x4dt to prevent a tight loop.
Simon Tatham
2005-10-17 18:41:05 +00:00
f9168d6003Just noticed a longhand shuffling operation which I must have missed when I converted them all into calls to shuffle().
Simon Tatham
2005-10-17 18:32:24 +00:00
5f16a29d4cJanes H provides a small workaround for a Palm tools bug.
Simon Tatham
2005-10-15 16:03:14 +00:00
3bee86241cSmall error in solver diagnostics.
Simon Tatham
2005-10-15 15:01:40 +00:00
e841ab4367Revamp of the control mechanism to permit drag- as well as click-based control. Only used for right-dragging to clear a large area to NONTENT.
Simon Tatham
2005-10-14 12:23:41 +00:00
669bb81f08New puzzle: `Tents'. Requires a potentially shared algorithms module maxflow.c. Also in this checkin, fixes to the OS X and GTK back ends to get ALIGN_VNORMAL right. This is the first time I've used it! :-)
Simon Tatham
2005-10-13 18:30:24 +00:00
29afca3ef9loopy_diffnames[] isn't used, and provokes a warning on OS X.
Simon Tatham
2005-10-13 18:27:57 +00:00
2bef4dfb50Yikes! I've only just noticed that this copy of tree234.c was still using unwrappered malloc/free, leaving plenty of openings for out- of-memory segfaults. Switch to using Puzzles's memory management, which I should have done right at the start but can only assume I forgot about.
Simon Tatham
2005-10-12 17:57:40 +00:00
7e57366a57r6384 didn't go quite far enough. In fact, a grid square which differs between oldstate and state in only the hint bit should not have a flip animation even if hints_active is TRUE. Flip animations should only happen for tiles which are changing their primary state. (Put like that, it seems so obvious.)
Simon Tatham
2005-10-10 17:22:33 +00:00
dd175e490aFixes for handling human-entered Flip games. The clicked-on square always got a flip animation even when it wasn't one of the ones being turned, and a square with no effect at all was still counting as a move.
Simon Tatham
2005-10-10 16:31:26 +00:00
813cd5e3bfRichard Earnshaw points out that if you enter an out-of-range number in the game description, the solver will fail to notice it and overrun an array leading to assertion failure, silent wrong answers or (in extreme cases) segfaults. Hence, validate_desc() now spots them and kicks them out.
Simon Tatham
2005-10-10 16:29:58 +00:00
8a8474a311Use game_set_size() to set up the temporary drawstate in game_print(), wherever feasible. This fixes a specific bug in Loopy (James H's new field ds->linewidth wasn't being set up, leading to corrupted print output), but I've made the change in all affected files because it also seems like a generally good idea to encourage it for future games, to prevent other problems of this type.
Simon Tatham
2005-09-23 12:50:51 +00:00
733e3c6bc7Fix very strange indentation issue!
Simon Tatham
2005-09-23 12:43:42 +00:00
71966d06a2Bug fix from James H: prevent LINEWIDTH ever reaching zero.
Simon Tatham
2005-09-18 17:00:07 +00:00
c8145f3bbaAnother optimisation patch from Mike, which (among other things) eliminates gratuitous duplication of the solver state every time it goes round the main loop, in favour of the usual type of `done_something' flag.
Simon Tatham
2005-09-18 12:09:16 +00:00
8730242870Optimisation patch from Mike: remember which squares we've entirely finished dealing with, and don't do them again on the next loop.
Simon Tatham
2005-09-15 18:09:27 +00:00
a5891971c1Patch from Mike: fix an array indexing error in the clue highlighting, and adjust the presets.
Simon Tatham
2005-09-13 18:34:12 +00:00
c389f623f6Patch from Mike: - remove the backtracking Hard' level, on the grounds that it was incredibly slow and not really usable. - introduce an Easy' difficulty level below the standard one; many people seem to find this puzzle unusually hard, so an easy level is particularly helpful. - highlight unfulfillable clue squares (but not yet any other types of obvious error).
Simon Tatham
2005-09-12 17:13:26 +00:00
a8980f3736I am again gormless! When I overhauled Solo's grid generator in r6160, I completely failed to ensure that generated grids were _at most_ the required difficulty. It appears to have been only random chance that prevented a request for a Trivial puzzle from producing Extreme. Here's a one-line fix.
Simon Tatham
2005-09-12 17:09:29 +00:00
f07576f49eI found a slightly odd-looking line of code in this file a few days ago, and nearly changed it to the obvious thing. After some thought, though, I've decided the `bug' is better off unfixed, and added a comment explaining why.
Simon Tatham
2005-09-12 12:38:58 +00:00
f71630073fMinor improvement to initial loop generation.
Simon Tatham
2005-09-11 18:05:23 +00:00
6bbcf248aaOops; left some rogue diagnostics in.
Simon Tatham
2005-09-11 14:53:39 +00:00
3d3d00991aRun the final solution-reduction pass in both directions, since Gareth managed to find an example (10x8#458168771440033 in r6289) where running it in only one direction failed to eliminate an obviously redundant piece of path.
Simon Tatham
2005-09-11 14:22:32 +00:00
b25fcc3f26Solve function for Inertia, using what's essentially an approximate TSP algorithm.
Simon Tatham
2005-09-11 12:40:49 +00:00
08c8cf370eMarginally greater robustness in the face of solve_game() failing to return an error message.
Simon Tatham
2005-09-11 11:57:24 +00:00
efda6cff49Completely rewrite the loop-detection algorithm used to check game completion, _again_. In r6174 I changed it from dsf to conventional graph theory so that it could actually highlight loops as opposed to just discovering that one existed. Unfortunately, yesterday I discovered a fundamental graph-theoretic error in the latter algorithm: if you had two entirely separate loops connected by a single path, the path would be highlighted as well as the loops.
Simon Tatham
2005-09-10 09:39:29 +00:00
72989cdf1dPatch from James H which initialises a couple of Windows API object handles to NULL before accidentally trying to use them for anything.
Simon Tatham
2005-09-10 08:31:22 +00:00
f8d1183c7aI arranged that dying after the game was already completed didn't increment the deaths counter. In doing so, I incorrectly handled the borderline case, so that a death incurred _in the act_ of collecting the final gem also didn't increment the deaths counter. Now it does.
Simon Tatham
2005-09-06 22:28:04 +00:00
aec9667f00Take the Windows taskbar into account when deciding on the maximum size of the puzzle window. This has involved some _completely stupid_ window manipulation: in order to figure out in advance how big I want my main window to be, I first have to _create_ the status bar so I know how tall it is; but since I can't reparent it into my main window after I've created it, I then have to throw that status bar away and create a new one. *sigh*
Simon Tatham
2005-09-06 18:49:18 +00:00
7096df54deVarious patches from Ben H: a fix for an outdated comment, a couple of spurious ps_printf() arguments removed, and an error check in the `make install' target.
Simon Tatham
2005-09-05 17:21:05 +00:00
56ff3647e2I've dithered a bit in the past about whether or not it's allowable to call game_set_size() twice on the same drawstate. Finally, a definite decision: it isn't. Accordingly, midend.c arranges never to do so, the devel docs state that puzzles may enforce by assertion that it never happens, and the four puzzles which care (i.e. use blitters) do so.
Simon Tatham
2005-09-05 17:18:03 +00:00
fd1735170ePatch from Ton van Overbeek to fix a small memory leak in midend_solve().
Simon Tatham
2005-09-04 12:53:27 +00:00
fe65b2efbdPatch from Ton van Overbeek to correct Loopy's misplaced line ends at small tile sizes.
Simon Tatham
2005-09-04 12:46:19 +00:00
dd7c1c983cAnother global environment-variable override across all games. This one is <game>_TILESIZE, adjusting the game's default size. I anticipate that this will probably _mostly_ be useful for debugging.
Simon Tatham
2005-09-04 12:40:23 +00:00
6ee8a4d71eCouple of minor updates to restore accuracy.
Simon Tatham
2005-09-04 12:31:04 +00:00
41b9855da9Patches from James H. The usual stuff (memory leak fixes and 16-bit cleanliness), plus he's enlarged the pencil-mark circles from TILESIZE/8 to TILESIZE/7. Makes no difference at all (thanks to integer division) when TILESIZE is the default of 20, but presumably helps at some other tile sizes. Fine by me.
Simon Tatham
2005-09-03 18:32:58 +00:00
d7c12b3122Someone points out that the Solo text formatter would be a lot better if it marked empty cells with something other than a space. So here's a three-bit change to turn it into a dot :-)
Simon Tatham
2005-09-02 13:40:16 +00:00
8d4b62c9bdStop Light Up from eating system keypresses, which it was previously doing whenever the cursor was active.
Simon Tatham
2005-09-01 17:25:06 +00:00
bd5606ae74Optimiser placation.
Simon Tatham
2005-09-01 12:17:14 +00:00
643f468255Palm fixes for Loopy from James H: a #ifdef SLOW_SYSTEM, and an int/long fix.
Simon Tatham
2005-09-01 12:00:55 +00:00
04e26aaa7bJames H's memory leak fixes to Inertia.
Simon Tatham
2005-09-01 11:59:51 +00:00
94b36c11e0James H has implemented a new `Tricky' difficulty level in Light Up: a non-recursive level above Easy, which therefore moves the recursive Hard mode further up still. Play-testing suggests that in fact Tricky is often _harder_ than the old Hard mode, since the latter had limited depth of recursion and would therefore spot complex deductions only if it happened to start a recursion on the right square; Tricky may be limited in the sophistication of its complex deductions, but it never misses one, so its puzzles tend to be hard all over.
Simon Tatham
2005-09-01 11:57:56 +00:00
6992530a85Ability to drag pencil marks around.
Simon Tatham
2005-08-31 19:27:41 +00:00
c70312f8a8Terribly cunning approach to making the pencil marks look nicer, thanks to Gareth.
Simon Tatham
2005-08-31 17:34:47 +00:00
7b08221952Debian requires -lm, where Red Hat didn't.
Simon Tatham
2005-08-31 16:59:51 +00:00
068a092cd5Ahem; forgot about recursion. Recursive solving now shows its working as well.
Simon Tatham
2005-08-31 12:43:14 +00:00
f2ff444fcaNow that Map has some seriously complex deductions, it's about time it had a command-line solver. In order to do this, I've had to expose the internal region numbering because the solver has to have some way to state which region it means; and in any case it's also useful to have human-visible region numbering so that two people can discuss a puzzle they're solving together. So pressing L during play now toggles the display of region numbers; and `mapsolver' uses those same numbers when showing its working and its solutions.
Simon Tatham
2005-08-31 12:17:01 +00:00
121f664b62Forcing chains in Map give rise to a new `Hard' difficulty level. Also implemented the Map analogue of Solo's pencil marks, to make this mode more playable.
Simon Tatham
2005-08-30 19:42:45 +00:00
e7a02ae333Implemented a couple more reasoning modes for Extreme difficulty level: positional set elimination (which is so obvious I really should have thought of it myself, though it's tricky to spot) and forcing chains (which are a type of one-level proof by contradiction, findable through a simple breadth-first search without requiring recursion, but so ludicrously powerful that they are able to solve _two thirds_ of grids that the pre-Extreme Solo generated and rated as Unreasonable).
Simon Tatham
2005-08-30 17:44:18 +00:00
948c33c5a9Backspace and Delete keys now function like Space in Solo.
Simon Tatham
2005-08-29 11:12:05 +00:00
4d6c8c7337Typo in comment :-)
Simon Tatham
2005-08-29 09:14:35 +00:00
ea9142fbdaAhem. The region density at which things start to get hairy is 2/3 of the grid area, not 3/2!
Simon Tatham
2005-08-29 09:05:35 +00:00
2c85fd3530Aesthetic improvements to the Map error indicators: - the exclamation mark was a bit dot-heavy - allowing the indicator to be placed at a grid point as well as half way between two grid points allows some much more natural positioning.
Simon Tatham
2005-08-29 08:57:45 +00:00
2975ae2811Unreasonable mode for Map.
Simon Tatham
2005-08-28 14:29:19 +00:00
e483fc513bError highlighting in Map.
Simon Tatham
2005-08-28 13:53:07 +00:00
8f46a30e69There seems to be some odd behaviour when GTK is asked to draw an outline polygon with a clipping rectangle active. I don't know or care whether this is GTK or my X server or what, but I'm working around it by drawing the lines myself, which seems to sort it out.
Simon Tatham
2005-08-28 13:52:58 +00:00
1d0573109cHACKING.but -> devel.but
Jacob Nevins
2005-08-28 09:35:55 +00:00
389397eed6Fix array bounds violation in the solver. Oops.
Simon Tatham
2005-08-27 09:53:38 +00:00
8c547d5320OS X seems particularly picky about possibly uninitialised variables. Placate its optimiser (again).
Simon Tatham
2005-08-27 09:35:14 +00:00
622a5ff678New puzzle: `Inertia', originally written for Windows by Ben Olmstead and reimplemented with the help of his source code which he was kind enough to release into the public domain.
Simon Tatham
2005-08-27 09:21:22 +00:00
067f06053cTrivial doc changes after recent prolificacy.
Jacob Nevins
2005-08-26 19:44:25 +00:00
d6163f9976Memory leak and type safety fixes from James H.
Simon Tatham
2005-08-25 18:14:54 +00:00
2520b86965Phil Bordelon points out that the general convention is to orient rectangular presets in a portrait fashion.
Simon Tatham
2005-08-25 08:07:44 +00:00