aboutsummaryrefslogtreecommitdiff
path: root/slant.c (follow)
Commit message (Collapse)AuthorAge
...
* Cleanup: it was absolutely stupid for game_wants_statusbar() to be aSimon Tatham2005-10-22
| | | | | | | | | 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. [originally from svn r6417]
* Cleanup: remove the game_state parameter to game_colours(). No gameSimon Tatham2005-10-22
| | | | | | | | | | | | 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(). [originally from svn r6416]
* Cleanup: the `mouse_priorities' field in the back end has been aSimon Tatham2005-10-22
| | | | | | | more general-purpose flags word for some time now. Rename it to `flags'. [originally from svn r6414]
* Use game_set_size() to set up the temporary drawstate inSimon Tatham2005-09-23
| | | | | | | | | | | | | | | | | | 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. There is one slight snag, which is that Map _can't_ do this because its game_set_size() also initialises a blitter. I could fix this by abstracting the common parts of Map's game_set_size() out into a subfunction called by game_set_size() and also called directly by game_print(); alternatively, I could introduce a means of determining whether a `drawing *' was for screen or printing use. Not sure which yet. [originally from svn r6340]
* Completely rewrite the loop-detection algorithm used to check gameSimon Tatham2005-09-10
| | | | | | | | | | | | | | | | | 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. Therefore, I've reverted to the original dsf technique, combined with a subsequent pass to trace around each loop discovered. This version seems to do a better job of only highlighting the actual loops. [originally from svn r6283] [r6174 == 2bd8e241a93165a99f5e2c4a2dd9c3b3b1e3c6f3]
* James H has implemented a new `Tricky' difficulty level in Light Up:Simon Tatham2005-09-01
| | | | | | | | | | | | | | | | | | 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. Also in this checkin, a new source file `nullfe.c', containing all the annoying stub functions required to make command-line solvers link successfully. James wrote this for (the new) lightupsolver, and I've used it to simplify the other stand-alone solvers. [originally from svn r6254]
* 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]
* 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]
* 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]
* 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]
* 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]
* 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]
* 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]