Dominosa: add area-parity deductions, at Basic level.

This is a technique I've had on the todo list (and been using by hand)
for years: a domino can't be placed if it would divide the remaining
area of the grid into pieces containing an odd number of squares.

The findloop subsystem is already well set up for finding domino
placements that would divide the grid, and the new is_bridge query
function can now tell me the sizes of the area on each side of the
bridge, which makes it trivial to implement this deduction by simply
running findloop and iterating over the output array.
This commit is contained in:
Simon Tatham
2019-04-13 13:46:31 +01:00
parent bb926f4ee4
commit 9f0dfba5fa
2 changed files with 118 additions and 25 deletions

View File

@ -1,6 +1,6 @@
# -*- makefile -*-
DOMINOSA_EXTRA = laydomino dsf sort
DOMINOSA_EXTRA = laydomino dsf sort findloop
dominosa : [X] GTK COMMON dominosa DOMINOSA_EXTRA dominosa-icon|no-icon