aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
...
* Change the policy for parsing underspecified params strings.Simon Tatham2014-11-29
| | | | | | | | | | | | | | | | | | | In conversation with a user last week, it emerged that the command 'solo --generate 1 9jk#12345' was giving a different game from the one it gave when I ran it, and it turns out that this is because I've set SOLO_DEFAULT=7jxdi in my environment to make GUI Solo automatically start up in my (current) favourite mode. And the difficulty setting from that parameter string was being reused to fill in the unspecified difficulty slot in the '9jk', so that the same params string was being interpreted differently by our two machines. This is certainly wrong - the whole point of random seed strings like that is to be interpreted the same way everywhere. But it's a side effect of something I did do on purpose, for people switching back and forth between playing randomly generated games and playing a game id pasted (or typed) in from elsewhere. So this fix, with a giant comment explaining it, I _think_ should retain the behaviour I originally wanted while getting rid of the behaviour I didn't.
* Remove an inappropriate assertion in validation context.Simon Tatham2014-11-26
| | | | | | | | | | spec_to_dsf() should not report invalid input by failing an assertion, because one of the contexts it's called from is validate_desc(), in which the whole point is to present a useful error message to the user before getting to the point where an assertion might go off at all. Game description 5j:c1_5o4_3c,c___aba___cca_a_a_aca now fails validation cleanly, where previously it would trigger this bug.
* Fix a decoding bug in Solo block-structure descriptions.Simon Tatham2014-11-26
| | | | | | | | Due to a copy-and-paste error, I was accidentally treating 'y' as the special-case character which puts no 1 bit after the run of 0s, which should have been 'z'. Game id 9jk#12345-5994 failed an assertion as a result (because it generates a y which was accidentally treated as special).
* Fix error highlighting of closed subgraphs in Bridges.Simon Tatham2014-10-29
| | | | | | | | | | | | | | When I did the recent rewrite of the Bridges drawing code, I spotted and replicated the code in game_redraw that set G_WARN at redraw time on an island with unsatisfiable clues, but didn't spot the code elsewhere (e.g. map_group_check) which might have set G_WARN ahead of time, so I failed to check for that. As a result, if you join some islands together into a subgraph with no further room for expansion (e.g. connect a pair of 1s together, or a pair of 2s with a double bridge) then all the bridges in that subgraph light up red but the islands themselves forget to. Trivial one-line fix.
* Some more .gitignore updates.Simon Tatham2014-10-27
| | | | Ignore a few things that turn up in the icons subdirectory.
* Add a .gitignore, now this project is in git.Simon Tatham2014-10-25
|
* Stop using NSApp in the OS X front end.Simon Tatham2014-10-20
| | | | | | | | | | | | | | As of OS X 10.10 (Yosemite), this causes a compile failure, which according to the Internet is because NSApp is a generic 'id' (Objective-C's answer to void *), which causes the compiler to select the wrong method for [NSApp setDelegate:...] and give a spurious type warning. Fixed by using [NSApplication sharedApplication] throughout, or rather, calling that once at startup and assigning the result into my own global variable which will do as an NSApp replacement. [originally from svn r10286]
* Fix antialiasing artifacts around edges of Bridges islands.Simon Tatham2014-10-07
| | | | | | | | | | | | | | | | | | When an island changes colour (because it becomes locked or highlighted, or goes back to plain COL_FOREGROUND from one of those states), we were just redrawing a filled circle over the previous one, which only really worked before antialiasing was introduced. Fixed by reworking the entire drawing edifice to be grid-square based, so that every grid square is either redrawn in full or left alone. Grid squares come in two types - island and bridge - but a bridge square can have neighbouring islands overlap into it, and the bridges entering an island overlap the island square too, so we end up with quite a large collection of bitfields describing each square's contents, and some care must be taken to draw each square in the right order. [originally from svn r10282]
* Provide a static version.h for development builds.Simon Tatham2014-09-27
| | | | | | | | | | | I forgot to add this in last week's versioning revamp, meaning that dev builds straight from source control would fail for lack of version.h because Buildscr is the only thing that knows how to create it. Other projects that I restructured this way come with a static version of version.h so that local builds can still work; I forgot that in this one. [originally from svn r10274]
* Remove the MD5-based manifest file system.Simon Tatham2014-09-24
| | | | | | | | | | | | A long time ago, it seemed like a good idea to arrange that binaries of my puzzles would automatically cease to identify themselves as a particular upstream version number if any changes were made to the source code, so that if someone made a local tweak and distributed the result then I wouldn't get blamed for the results. Since then I've decided the whole idea is more trouble than it's worth, so I'm retiring it completely. [originally from svn r10264]
* Remove dependencies on Subversion.Simon Tatham2014-09-24
| | | | | | | | | | | | | | | | I'm going through all my projects and reworking them to avoid depending on the monotonic integer-valued source control revision identifier provided by Subversion, so I can migrate everything to git without my builds and versioning breaking. Puzzles's version number is now of the form YYYYMMDD.vvvvvv, where vvvvvv is some string of source control information (currently still the SVN-style "rNNNNN", but free to change in future). The date provides monotonicity between my official automated builds, and the second component is the one I'll be most interested in when people send bug reports. [originally from svn r10263]
* Improve connectedness-error highlighting in Singles.Simon Tatham2014-09-21
| | | | | | | | Using exactly the same policy as I did for Range the other day: if multiple regions exist, then one is taken to be canonical and all the others are marked as errors. [originally from svn r10233]
* Improve connectedness-error highlighting in Range.Simon Tatham2014-09-09
| | | | | | | | | | | The previous approach of scanning the grid by depth-first search was fine for deciding whether it was connected, but not so good for pointing out where the mistake was in the grid. Replaced that code with a dsf-based version, which identifies all connected components so that an easy followup pass can highlight all but the largest as erroneous. [originally from svn r10223]
* Fix vertically misaligned text in Javascript puzzles.Simon Tatham2014-06-21
| | | | | | | | | | When I constructed my test canvas to measure the vertical extent of a text string for ALIGN_VCENTRE, I forgot to ensure that the 'width' variable was an integer, as a result of which the loop over canvas pixels kept trying to use fractional array indices and returning undefined :-) [originally from svn r10196]
* Change our method of calling main() in emccpre.js.Simon Tatham2014-04-20
| | | | | | | | | | | I've just upgraded to emcc 1.16.0, in which something fiddly has happened to the semantics of Module.run() vs noInitialRun - now setting the latter seems to cause the former to do everything except calling main(), and then refuse to ever do anything again. So now I have to use Module.callMain() in place of Module.run() when I finally do get round to wanting to call main(). [originally from svn r10180]
* Add a missing #include.Simon Tatham2014-04-20
| | | | [originally from svn r10179]
* Reinstate the Mac OS build step.Simon Tatham2014-03-30
| | | | | | Now I've got a working Mac, I can build it again. [originally from svn r10167]
* Fix the Automake makefile for automake 1.14.Simon Tatham2014-02-22
| | | | | | | | | | | | | | | This is a combination of PuTTY r10142 and the relevant pieces of r10141: we now enable the 'subdir-objects' mode in Makefile.am, and stop using $(subdir) in source file paths. (As a consequence of the latter the automake machinery now cannot live anywhere but at the top level of the source tree, but since that's where it was already, this is less of an upheaval here than it was for PuTTY!) [originally from svn r10146] [r10141 == a947c49bec36957cb5d38e1dc2e22dc0e3465849 in putty repository] [r10142 == 0da225829234744b1141aea3a7c54ad7d74679a7 in putty repository]
* Continue the tradition of only remembering to update the copyright yearJacob Nevins2014-01-16
| | | | | | every other year. [originally from svn r10116]
* Position the monster counts more sensibly.Simon Tatham2014-01-07
| | | | | | | | | | | | | | Now they're centred within the spare grid cell at the top of the playing area, rather than being too far down so that the bottoms of the monster drawings collide with the background of the path clues at large magnification. Also, while I'm here, I've simplified the code that draws the monster counts, by moving duplicated parts out of the branches of the 'if'. (In fact, almost all of this patch is cleanup; the only substantive change is the one that changes dy from TILESIZE/2 to TILESIZE/4.) [originally from svn r10108]
* Fix a printf 64-bit-cleanness error.Simon Tatham2013-11-28
| | | | [originally from svn r10098]
* Fix an edge case of divider-obsoletion in Group.Simon Tatham2013-10-09
| | | | | | | | | | | When you drag group elements around, previous dividers are meant to dissolve whenever the same two elements are no longer on each side of it. One case in which this didn't happen was that of dragging an element from the left of a divider to the far right column - the divider became invisible, but would then startlingly reappear if you drag that element back to the left of whatever it was left of before. [originally from svn r10051]
* Faintly highlight the leading diagonal of Group's grid.Simon Tatham2013-10-09
| | | | | | | This makes it easier to spot elements whose square is known, which is useful in turn for identifying subgroups. [originally from svn r10050]
* Document 'Unique rows and columns' option in Unruly, plus formatting tweaksJacob Nevins2013-08-29
| | | | | | elsewhere. [originally from svn r10035]
* Fix a failure to warn about non-unique rows/columns in non-square Unruly ↵Jacob Nevins2013-07-30
| | | | | | grids, reported in Debian bug #718354. [originally from svn r9976]
* Stop using a zero precision specifier with sprintf ("%.0d") to causeSimon Tatham2013-07-05
| | | | | | | | | zero to be generated as the empty string rather than "0". Instead, do the job by the obvious approach of not calling sprintf at all if the number is zero. Works around a bug in Emscripten's C library, whose sprintf doesn't correctly handle that corner case. [originally from svn r9893]
* Make svn-based version identification still work in VPATH builds.Simon Tatham2013-07-02
| | | | [originally from svn r9891]
* Fix small bugs in the automake construction which were preventing theSimon Tatham2013-07-02
| | | | | | | revision number from being automatically baked into the automake-built binaries. [originally from svn r9890]
* Add a check in the new configure script to enable lots of gcc warningSimon Tatham2013-06-30
| | | | | | | | | | | flags if gcc is in use - but _only_ if they don't lead to problems in a test compile which includes all the system and GTK headers I'm going to want. Ubuntu 13.04 includes a version of Pango which breaks at -Werror -pedantic, so I can't unconditionally enable all the warning flags I might want without breaking the build in ways beyond my control. [originally from svn r9888]
* Add a mechanism to the automake system to allow 'make install' to onlySimon Tatham2013-06-30
| | | | | | install the actual games, not the auxiliary binaries or nullgame. [originally from svn r9887]
* Support building via autoconf and automake. mkfiles.pl now outputs aSimon Tatham2013-06-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makefile.am, and there's a new mkauto.sh which builds a corresponding configure script. The old makefile has been renamed from 'Makefile' to 'Makefile.gtk', indicating that the intended new _default_ approach is to use the autoconf world. Makefile.gtk is provided as an emergency fallback in case anything fails with the new stuff that used to work with it. The new configure script does not support the same $(BINPREFIX) system as the old Makefile did. However, as I understand it, it should be possible to configure using --program-prefix="sgt-" (for example) and then the binaries should all be renamed appropriately at install time. The Makefile.am is quite painful. The Puzzles codebase relies heavily on compiling individual object files multiple times with different the cpp flags per build deliverable (program or library) and not per source file. Solution: anything built with non-default compile options has to go in its own little library. But that doesn't work either in the general case, because as soon as you have more than one such library linked into an application, Unix ld semantics bite you if the objects in the libraries both refer to each other. So I ended up building all those little libraries but not _using_ them - instead the link commands for the programs needing those objects refer to the objects directly, under the silly names that automake gives them. (That's less fragile than it sounds, because it does _document_ the names of the intermediate object files. But still, yuck.) [originally from svn r9886]
* Adjust the build script to turn the NestedVM build into a delegation,Simon Tatham2013-06-27
| | | | | | | so that not every machine on which I want to run the full Puzzles build will have to have a local NestedVM installation. [originally from svn r9882]
* Remove stray bashisms from the NestedVM makefile.Simon Tatham2013-06-19
| | | | [originally from svn r9872]
* Remove spurious "unfinished/" that appeared at the start of theSimon Tatham2013-06-08
| | | | | | unfinished puzzles' gamedesc.txt lines due to a Perl error. Ahem. [originally from svn r9861]
* Add comment to remind myself (and anyone else) how to refresh the XFCESimon Tatham2013-06-08
| | | | | | menu. [originally from svn r9860]
* Script to read the new gamedesc.txt and create .desktop files. MySimon Tatham2013-06-08
| | | | | | | | | | immediate intention is to run this locally so that my XFCE main menu acquires shortcuts for my locally compiled puzzle binaries, but I expect the script could probably be adapted for systemwide distribution use if any distribution hasn't already done this job in their own way by now. [originally from svn r9859]
* Rename wingames.lst to gamedesc.txt, and add a couple of extra fieldsSimon Tatham2013-06-08
| | | | | | | | | to it giving each game's "internal" name (as seen in the source file, .R etc) and also a brief description of the game. The idea of the latter is that it should be usable as a comment field in .desktop files and similar. [originally from svn r9858]
* Fix grid generation crashes at Penrose 3x3 sizes. What seemed to beSimon Tatham2013-05-10
| | | | | | | | | | | | | | | happening was that at the point of calling grid_make_consistent, the grid had no faces or vertices, probably because grid_trim_vigorously had removed them all, causing grid_make_consistent to try to allocate a negative amount of memory and die in snewn. Fixed by detecting this case in new_desc_penrose and retrying until generation is successful. (It wasn't happening 100% of the time, just _most_ of the time.) The same verification step is also used in validate_desc_penrose in case a user manages to manually construct a set of parameters leading to this failure mode. [originally from svn r9840]
* Correct the comment at the top of unruly.c, which is out of date as ofSimon Tatham2013-05-05
| | | | | | | r9837. [originally from svn r9838] [r9837 == 2f7831bb1626d82baff706e507d61a820ad84df1]
* New configuration option in Unruly, to enable a mode in which no twoSimon Tatham2013-05-05
| | | | | | | | | | | | | | 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]
* D'oh, forgot to adjust devel.but for the const changes.Simon Tatham2013-04-13
| | | | [originally from svn r9835]
* 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]
* Patch from Rogier Goossens to speed up the Pattern solver.Simon Tatham2013-04-12
| | | | | | | | | | | | | | | | do_recurse() now prunes early whenever it encounters a branch of the search tree inconsistent with existing grid data (rather than the previous naive approach of proceeding to enumerate all possibilities anyway and then ruling them out one by one); do_recurse also tries to split the row up into independent sections where possible; finally the main solver loop (all three copies of which have now been factored out into a new solve_puzzle function), instead of simply looping round and round over all the rows and columns, heuristically looks at the ones most changed since the last time deduction was attempted on them, on the basis that that will probably yield the most information the fastest. [originally from svn r9828]
* Adjust Keen's grid generation to constrain the maximum size of clueSimon Tatham2013-04-12
| | | | | | | | | | blocks, because 'make test' showed up very large blocks as an occasional slowdown factor in game generation (takes too long to iterate over all possibilities). This is a good idea in any case, because really big multiplicative clue numbers have trouble fitting in the square. [originally from svn r9827]
* Apply some optimisation to Undead's get_unique() function, which wasSimon Tatham2013-04-12
| | | | | | | | | | | | | | | | | | not only enumerating all possible arrangements of monsters along a sight-line in O(3^n) time, but also allocated memory for them all and then does a quadratic-time loop over that list to find arrangements with a unique visibility count from both ends. Spotted by the new 'make test', which observed that 7x7dn#517035041807425 took 45 seconds to generate. This revised version still does the initial O(3^n) enumeration, which can probably be got rid of as well with a bit more thought, but it now doesn't allocate nearly so much memory and it spots uniques efficiently. The above random seed now generates the same game ID in less than a second, which drops this puzzle off the 'make test' hit list of things most obviously needing speedup. [originally from svn r9826]
* Introduce some extra testing and benchmarking command-line options toSimon Tatham2013-04-11
| | | | | | | | | | | | | | | | the GTK front end, plus a 'make test' target in the GTK makefile which uses them to automatically generate 100 puzzles for each game at each preset configuration, test-run them back through the solver without their aux_info to ensure that can cope, and produce an HTML box plot of game generation times for each preset. As part of this work I've removed the TESTSOLVE mechanism from r9549, since the new --test-solve option does the same thing better (in that when something goes wrong it prints the random seed that caused the problem). [originally from svn r9825] [r9549 == 5a095b8a08fa9f087b93c86aea0fa027138b028d]
* Revamp the triangular grid generation in Loopy, which I've beenSimon Tatham2013-04-11
| | | | | | | | | | | | | | | | meaning to revisit for a while. The new version generates more nicely symmetric grids (best at even heights, but still improved even at odd heights), and avoids any 'ears' on the grid (triangles at the corners connected to only one other triangle, which tend to be boringly easy places to start solving). I've reused the grid-description-string mechanism invented for the Penrose tilings as a versioning mechanism for the triangular grids, so that old game descriptions should still be valid, and new triangular- grid game descriptions begin with an "0_" prefix to indicate that they are based on the new-style construction. [originally from svn r9824]
* Split Untangle's background colour into two. COL_BACKGROUND is stillSimon Tatham2013-04-07
| | | | | | | | | | | | | | | defined the same way and used to draw the normal background of the puzzle, but there's a new slightly darker COL_SYSBACKGROUND which is not used for anything at all in the puzzle backend but which occupies colour slot #0 so that the system will use it to fill around the playable area if the puzzle is imprecisely resized. This doesn't _sensibly fix_ the annoyance in Untangle where a non- square window gives rise to unusable dead space, but it at least works around it by making the dead space obviously something to stay away from. [originally from svn r9823]