aboutsummaryrefslogtreecommitdiff
path: root/flood.c (follow)
Commit message (Collapse)AuthorAge
* Add a missing error message in Flood solve_game().Simon Tatham2015-12-24
| | | | | | The only situation in which it actually can't find a solution is if the puzzle is already solved, in which case it can at least fill in *error to say so before it returns NULL.
* Fix a compile warning on ARM.Simon Tatham2015-03-24
| | | | | | | | | | | Aapo Rantalainen points out that comparing 'char c' against zero gives rise to gcc's "comparison is always false" warning, which escalates to an error under -Werror. This is one of those situations where the warning is doing more harm than good, but here's a rephrasing which casts to unsigned so that both negative numbers and positive out-of-range ones can be caught by the same comparison.
* Improve the Flood solver.Simon Tatham2015-01-15
| | | | | | | | | | | | | | | Previously it simply chose every move based on the static evaluation function 'minimise the pair (longest shortest-path to any square, number of squares at that distance)'. Now it looks three moves ahead recursively, and I've also adjusted the evaluation function to tie- break based on the number of squares brought to distance zero (i.e. actually in control). The result isn't an unconditional improvement on the old solver; in a test run based on 'flood --generate 1000 12x12c6m0#12345' I found that 57 out of 1000 grids tested now had longer solutions. However, about three quarters had shorter ones, and solutions are more than a move shorter on average.
* Revise the Flood preset list.Simon Tatham2015-01-13
| | | | | | | The ones I started with were a bit under-varied and over-orthogonal. Get rid of some of the more pointless things like 16x16 with lots of extra moves, and add some with different colour counts. While I'm here, make the menu descriptions nicer.
* New puzzle: 'Flood'.Simon Tatham2015-01-12
Based on a web game I saw a few years ago, and dashed off this weekend after I thought of a way to write a good (though not quite optimal) heuristic solver, here's a random little thing not quite in the same line as the most usual kind of Puzzles fare: instead of making you scratch your head to find any move to make at all, it's easy to find solutions in principle, and the challenge comes from having to do so within a move limit.