chiark / gitweb /
Dominosa: allow set analysis even with adjacency.
authorSimon Tatham <anakin@pobox.com>
Wed, 3 Apr 2019 17:26:42 +0000 (18:26 +0100)
committerSimon Tatham <anakin@pobox.com>
Thu, 4 Apr 2019 22:58:31 +0000 (23:58 +0100)
commit453a2c1ca8971cb5b2cd1aef1c5c8a2fef6d107b
treec76643424ba24620b5774af3a3134a9f998822b9
parente2f52df5ec5a34ded78e95e9605c0bc810019bcd
Dominosa: allow set analysis even with adjacency.

I've always had the vague idea that the usual set analysis deduction
goes wrong when there are two adjacent squares, because they might be
opposite ends of the same domino and mess up the count. But I just
realised that actually you can correct for that by adjusting the
required count by one: if you have four 0 squares which between them
can only be parts of 0-0, 0-1 and 0-2, then the only way this can work
is if two of them are able to be the 0-0 - but in that case, you can
still eliminate those dominoes from all placements elsewhere. So set
analysis _can_ work in that situation; you just have to compensate for
the possible double.

(This enhanced form _might_ turn out to be something that needs
promoting into a separate difficulty level, but for the moment, I'll
try leaving it in Hard and seeing if that's OK.)
dominosa.c