aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* *blinks* I apparently didn't try _building_ the OS X port since theSimon Tatham2005-08-21
| | | | | | | printing upheaval. I could have sworn I had. Oh well; small errors fixed. [originally from svn r6197]
* Retire redundant print_line_width() in Net: a relic from a failedSimon Tatham2005-08-20
| | | | | | printing strategy, irrelevant to the one which worked. [originally from svn r6194]
* Native Windows printing support, using the infrastructure I put inSimon Tatham2005-08-20
| | | | | | | | | | | | | | | | | | | | | place in r6190. I'm quite pleased that I didn't have to modify the printing infrastructure _at all_ to make this work; the only source change required outside windows.c was the addition of a trivial utility function midend_get_params(), and that was for the benefit of bulk puzzle generation rather than anything to do with actual printing. As far as I can tell, all printable puzzles now print almost indistinguishably from the way they print under Unix. If you look closely the font is slightly different, and the Windows standard hatching doesn't seem to be quite as nice as the kind I did by hand in ps.c (and, particularly annoyingly, hatched areas don't show up at all for me when I print to a file and use gv, though they come out fine on the printer itself); but it's all there, and it all works. [originally from svn r6193] [r6190 == af59dcf6858264103bbc621761feee3aed5aaf2a]
* Richard B points out a cut and paste error.Simon Tatham2005-08-19
| | | | [originally from svn r6192]
* Bah, there's always one. Remove the now-erroneous `*.py' from theSimon Tatham2005-08-19
| | | | | | makedist script. [originally from svn r6191]
* Substantial infrastructure upheaval. I've separated the drawing APISimon Tatham2005-08-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | as seen by the back ends from the one implemented by the front end, and shoved a piece of middleware (drawing.c) in between to permit interchange of multiple kinds of the latter. I've also added a number of functions to the drawing API to permit printing as well as on-screen drawing, and retired print.py in favour of integrated printing done by means of that API. The immediate visible change is that print.py is dead, and each puzzle now does its own printing: where you would previously have typed `print.py solo 2x3', you now type `solo --print 2x3' and it should work in much the same way. Advantages of the new mechanism available right now: - Map is now printable, because the new print function can make use of the output from the existing game ID decoder rather than me having to replicate all those fiddly algorithms in Python. - the new print functions can cope with non-initial game states, which means each puzzle supporting --print also supports --with-solutions. - there's also a --scale option permitting users to adjust the size of the printed puzzles. Advantages which will be available at some point: - the new API should permit me to implement native printing mechanisms on Windows and OS X. [originally from svn r6190]
* Just noticed another thing that could easily catch me out whenSimon Tatham2005-08-15
| | | | | | adding a new puzzle. [originally from svn r6189]
* Memory leak fixes from James H.Simon Tatham2005-08-13
| | | | [originally from svn r6188]
* New puzzle: `Map'. Vaguely original, for a change.Simon Tatham2005-08-13
| | | | | | | | | | (This puzzle is theoretically printable, but I haven't added it in print.py since there's rather a lot of painful processing required to get from the game ID to the puzzle's visual appearance. It probably won't become printable unless I get round to implementing a more integrated printing architecture.) [originally from svn r6186]
* 16-bit-cleanness fixes from James H (again). It would be really niceSimon Tatham2005-08-11
| | | | | | | | | | to have some means of automatically spotting this sort of problem on a desktop platform, but I can't immediately think of one; building a trick compiler which thinks `int' is 16 bits would be the obvious option, but it would immediately break the ABIs to all the system functions. [originally from svn r6184]
* Very fiddly corrections to the loop highlighting. ERRSLASH means theSimon Tatham2005-08-09
| | | | | | | | | | | slash in this square is red, so it does indeed imply that some of the edge markings are also red; but it doesn't mean _all_ the edge markings must be red. So instead of assuming ERRSLASH implies all edge error markers, we set the correct set of edge error markers at the same time as setting ERRSLASH, at which point we know which kind of slash it is so we know which ones to set. [originally from svn r6175]
* Implement error checking in Slant. Clue points are now highlightedSimon Tatham2005-08-09
| | | | | | | | | | | | | | | in red if it's impossible to fulfill them (either through too many neighbours connecting to them, or too many not connecting to them), and edges are highlighted in red if they form part of a loop. In order to do this I've had to revamp the redraw function considerably. Each square is now drawn including its top and left grid edges, but _not_ its bottom or right ones - which means that I need to draw an extra strip of empty squares outside the actual grid in order to draw the few pixels which appear on the grid bottom and right borders and also to red-highlight border clues. [originally from svn r6174]
* Remove conditional definition of MAX_GRIDGEN_TRIES, for consistencySimon Tatham2005-08-07
| | | | | | between Palm and other ports when fed the same random seed. [originally from svn r6172]
* Placate optimiser.Simon Tatham2005-08-07
| | | | [originally from svn r6171]
* Streamline `slantsolver' a bit (avoid showing advanced working onSimon Tatham2005-08-06
| | | | | | | easy puzzles, and stop having a second encoding of the difficulty levels). [originally from svn r6170]
* Document hard mode in Slant, and also fix an obvious memorySimon Tatham2005-08-06
| | | | | | management error in game_configure(). [originally from svn r6169]
* Introduce an environment variable setting (SLANT_SWAP_BUTTONS=yes)Simon Tatham2005-08-06
| | | | | | | | | | | to reverse the effect of the mouse buttons. Gareth has been complaining about this for days: apparently he finds precisely the opposite control system intuitive to me. This is a horrendous hack, and pushes me one step closer to losing my temper and designing a proper preferences architecture. [originally from svn r6168]
* A bunch of new reasoning techniques in the Slant solver, leading toSimon Tatham2005-08-06
| | | | | | | a new Hard mode. Also added a command-line `slantsolver' which can grade puzzles and show working. [originally from svn r6167]
* Cleanups to completion flashes: all four of these games used toSimon Tatham2005-08-05
| | | | | | | | | redraw the whole window _every_ time game_redraw() was called during a flash. Now they only redraw the whole window every time the background colour actually changes. Thanks to James H for much of the work. [originally from svn r6166]
* New puzzle: `Light Up', by James H.Simon Tatham2005-08-04
| | | | | | | | | | Also in this checkin (committed by mistake - I meant to do it separately), a behind-the-scenes change to Slant to colour the two non-touching classes of diagonals in different colours. Both colours are set to black by default, but configuration by way of SLANT_COLOUR_* can distinguish them if you want. [originally from svn r6164]
* Environment-based configuration wasn't sensibly usable in games withSimon Tatham2005-08-04
| | | | | | | spaces in the name. Fixed. (One day I really must get round to turning this into a proper config mechanism.) [originally from svn r6163]
* Patch from James H: tinker with the presets on SLOW_SYSTEMs.Simon Tatham2005-08-04
| | | | [originally from svn r6162]
* Bug fix from James H: solve_game() was returning error messages inSimon Tatham2005-08-04
| | | | | | | | the return value rather than in *error. In the old days type- checking would have caught this, but now of course they're the same type. [originally from svn r6161]
* I am COMPLETELY GORMLESS. The Solo grid generator, when eliminatingSimon Tatham2005-08-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | clues from a filled grid, was using the algorithm - loop over the whole grid looking for a clue (or symmetry group of clues) which can be safely removed - remove it - loop over the whole grid again, and so on. This was due to my vague feeling that removing one clue might affect whether another can be removed. Of course this can happen - two clues can be alternative ways of deducing the same vital fact so that removing one makes the other necessary - but what _can't_ happen is for removing one clue to make another _become_ removable, since you can only do that by _adding_ information. In other words, after testing a clue and determining that it can't be removed, you never need to test it again. Thus, a much simpler algorithm is - loop over the possible clues (or symmetry groups) _once_, in a random order - for each clue (group), if it is removable, remove it. This still guarantees to leave the grid in a state where no further clues can be removed, but it greatly cuts down puzzle generation time and also simplifies the code. I am a fool for not having spotted this in three and a half months! [originally from svn r6160]
* Cleanups from James H: a few missing statics, a precautionary castSimon Tatham2005-08-03
| | | | | | | | | or two, a debugging fix, a couple of explicit initialisations of variables that were previously read uninitialised, and a fix for a whopping great big memory leak in Slant owing to me having completely forgotten to write free_game(). [originally from svn r6159]
* Slant uses the same generation strategy as Solo, despite not havingSimon Tatham2005-08-03
| | | | | | | | | the property which devel.but claimed to be the reason why that strategy works. A bit of thought revealed what the _real_ reason is why this strategy works in some puzzles and not others, so I've rewritten the paragraph to be more accurate. [originally from svn r6158]
* Bah! There's _always_ one. Display glitch corrected.Simon Tatham2005-08-02
| | | | [originally from svn r6156]
* New puzzle: `Slant', picked from the Japanese-language section ofSimon Tatham2005-08-02
| | | | | | | | | | | nikoli.co.jp (which has quite a few puzzles that they don't seem to have bothered to translate into English). Minor structural change: the disjoint set forest code used in the Net solver has come in handy again, so I've moved it out into its own module dsf.c. [originally from svn r6155]
* Various cleanups and clarifications to devel.but; some from RichardSimon Tatham2005-08-01
| | | | | | | | | B and some from me. Also an additional utility function `random_copy' from Richard B, which he says is useful in a new puzzle he's working on and which seems likely to come in handy again at some point. [originally from svn r6153]
* New end-game approach to Black Box. Instead of revealing the ballSimon Tatham2005-07-31
| | | | | | | | | | | positions immediately when you make an error, the game now reveals as little information as is necessary to prove you wrong (including none - if an existing laser path you know about is inconsistent with your guesses, the game will just point it out and tell you nothing new!) and you can try again. Errors are counted in much the same way as deaths in Mines. [originally from svn r6152]
* missing `i' in `\e'Jacob Nevins2005-07-29
| | | | [originally from svn r6151]
* One more fix from Ben H. Also switched round the arena colourSimon Tatham2005-07-29
| | | | | | | | | | | selection in the redraw function, so that locked squares are no longer displayed once the game is at an end. (It looked untidy and disorienting for lighter-coloured locked squares to suddenly become darker when the box was opened. You can still flip back and forth to your previous game state using undo/redo if you want to compare the results against your lock pattern.) [originally from svn r6150]
* Various fixes and cleanups suggested by Ben Hutchings:Simon Tatham2005-07-29
| | | | | | | | | | | | | | | | | - clarified wording of messages in validate_params(), including in particular a correction from `< 255' to `<= 255' - fixed random_upto() in game generation which caused the maximum number of balls never to be used when there was uncertainty - fixed widespread miscalculation of rectangular-array indices (multiplication by h instead of w, which would have broken non-square grids rather profoundly) - corrected an ANSI namespace violation - removed real functionality from the inside of assert() statements, so that the game should still work when compiled -DNDEBUG - couple of unnecessary linear-time loops removed. [originally from svn r6149]
* Ben Hutchings reports that gcc 4 gives an optimiser warning becauseSimon Tatham2005-07-29
| | | | | | | | it can't tell that one branch of a particular switch is always taken. Adding a default clause with an automatic assertion failure apparently fixes it. [originally from svn r6148]
* Patches from Ben Hutchings to fix failures of sscanf error checking.Simon Tatham2005-07-29
| | | | [originally from svn r6147]
* Tweak a paragraph after discussion with Simon.Jacob Nevins2005-07-29
| | | | [originally from svn r6144]
* Shiny new developer documentation to replace the old sketchy HACKINGSimon Tatham2005-07-28
| | | | | | guide. [originally from svn r6142]
* The very core of cross() is capable of suffering integer overflow onSimon Tatham2005-07-24
| | | | | | | | | | | large puzzles. Resort to hand-hacked 64-bit arithmetic for doing dot products; everything else remains in `long' for the moment. (Ideally I'd auto-detect the presence of `long long' and use it in place of my cheap plastic imitation where possible, but since I currently don't have a configure mechanism that'll have to wait.) [originally from svn r6137]
* Another diagnostic mode for Untangle: if compiled withSimon Tatham2005-07-24
| | | | | | | | | `-DSHOW_CROSSINGS', it will show each edge in red if it is crossed by anything, and in black otherwise. Distracting and not particularly useful during play, but occasionally handy for debugging cross(). [originally from svn r6136]
* (GTK only so far) Allow the argument passed to a game binary to beSimon Tatham2005-07-24
| | | | | | | | either a game ID or a save file name. (The former takes priority, because you can usually find a synonym for the latter, such as by prepending `./' or `$PWD/'.) [originally from svn r6135]
* Solve animation (currently only in Untangle) was failing to setSimon Tatham2005-07-22
| | | | | | | | me->anim_pos to zero, meaning that if it happened immediately after a completion flash then anim_pos would start off half way through its run. [originally from svn r6127]
* The `Solve' operation now rotates and/or reflects the solution gridSimon Tatham2005-07-22
| | | | | | | | | | | to bring it as close as possible to the current game state. This means that if you request `Solve' after solving a puzzle yourself, with the intention of finding out how similar your solution is to the program's, then you will mostly see the differences in _shape_ rather than those being masked by the fact that yours happened to be the other way up. [originally from svn r6126]
* James H profiled the new Same Game grid generator and discovered itSimon Tatham2005-07-22
| | | | | | | | | | | | | was spending 60% of its time in shuffle(). The purpose of the shuffle() call was to go through a largish array in random order until we found an element that worked, so there's no actual need to shuffle the whole array every time and I only did it out of laziness. So I now pick a random element each time I go round the loop, meaning I save a lot of shuffling effort whenever the loop terminates early (which is often). I get about a factor of two speed improvement from this small change. [originally from svn r6125]
* Until now, Same Game has been the only puzzle in this collectionSimon Tatham2005-07-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | which is unable to guarantee that every grid it generates can be solved. So I'm eliminating that exception: this checkin contains a more sophisticated grid generator which does guarantee solubility. It's a bit slow (most noticeably on the 15x10c3 preset), and the quality of the generated grids is slightly weird (a tendency toward small regions rather than large sweeping areas of contiguous colour); however, I'm willing to see the latter as a feature for now, since making the game more challenging while simultaneously guaranteeing it to be possible sounds like an all-round win to me. From now on I'm raising my standards for contributions to this collection. I made this fix to Same Game because I heard a user _automatically assume_ that any puzzle in my collection would not be so uncouth as to generate an impossible grid; as of this checkin that's actually true, and I intend to maintain that standard of quality henceforth. (Guaranteeing a _unique_ solution is more of an optional extra, since there are many games for which it isn't a meaningful concept or isn't particularly desirable. Which is not to say that _some_ games wouldn't be of unacceptably low quality if they failed to guarantee uniqueness; it depends on the game.) [originally from svn r6124]
* I've been meaning to do this for ages: all the Makefiles now giveSimon Tatham2005-07-21
| | | | | | | | | $(XFLAGS) _after_ $(CFLAGS) on the compiler command lines, meaning that you can provide options in XFLAGS on the makefile which will override the ones in CFLAGS. For example, `make XFLAGS=-O0' to make debugging easier. [originally from svn r6123]
* Sync with websiteJacob Nevins2005-07-20
| | | | [originally from svn r6122]
* The Untangle completion flash was weedy and anaemic; beef it up aSimon Tatham2005-07-20
| | | | | | | | | bit. In particular, it now flashes between _two_ specially picked colours (white and mid-grey), meaning that it should be visible even if your default background colour is white; and it also flashes twice rather than once. [originally from svn r6121]
* Some attempt to explain Dominosa for those unfamiliar with dominos. (Not sureJacob Nevins2005-07-19
| | | | | | I've succeeded.) [originally from svn r6120]
* Another fix from Chris: Guess's allow-blanks mode wasn't allowingSimon Tatham2005-07-18
| | | | | | blanks... [originally from svn r6118]
* Fix to Chris's patch in r6106 (also from Chris).Simon Tatham2005-07-18
| | | | | [originally from svn r6117] [r6106 == a31934f233581da07153af6b4ee717f1e63387dd]