chiark / gitweb /
Dominosa: add area-parity deductions, at Basic level.
authorSimon Tatham <anakin@pobox.com>
Sat, 13 Apr 2019 12:46:31 +0000 (13:46 +0100)
committerSimon Tatham <anakin@pobox.com>
Sat, 13 Apr 2019 14:57:16 +0000 (15:57 +0100)
commit9f0dfba5fa9431469060ae89bef486267dbb23d4
tree8022899dbf52894be8722c34a86e5937df0a09bd
parentbb926f4ee4c16f67d37398c1b79b54a3fdf1dedd
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.
dominosa.R
dominosa.c