simon-git: puzzles (master): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Fri Apr 5 00:01:40 BST 2019


TL;DR:
  f1c8e40 Dominosa: add a command-line solver.
  82ee3d4 Dominosa: rewrite the solver.
  6235f7f Dominosa: introduce a difficulty system.
  2ec6dae Dominosa: new deduction deduce_local_duplicate().
  e2f52df Dominosa: add a Hard difficulty which can do set analysis.
  453a2c1 Dominosa: allow set analysis even with adjacency.
  b0c73d5 Dominosa: update the to-do list.

Repository:     https://git.tartarus.org/simon/puzzles.git
On the web:     https://git.tartarus.org/?p=simon/puzzles.git
Branch updated: master
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2019-04-05 00:01:40

commit f1c8e4092cf1f31bbf5a3889bd47cbe1c5955f87
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=f1c8e4092cf1f31bbf5a3889bd47cbe1c5955f87;hp=68363231f062192156799af7a153fc3ab3a0f5ed
Author: Simon Tatham <anakin at pobox.com>
Date:   Tue Apr 2 18:42:01 2019 +0100

    Dominosa: add a command-line solver.
    
    I've made the existing optional solver diagnostics appear as the
    verbose output of the solver program. They're not particularly legible
    at the moment, but they're better than nothing.

 .gitignore |   1 +
 dominosa.R |   3 +
 dominosa.c | 215 +++++++++++++++++++++++++++++++++++++++++++++----------------
 3 files changed, 163 insertions(+), 56 deletions(-)

commit 82ee3d42a4fd4907b8a4c98579d934176654eb7d
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=82ee3d42a4fd4907b8a4c98579d934176654eb7d;hp=f1c8e4092cf1f31bbf5a3889bd47cbe1c5955f87
Author: Simon Tatham <anakin at pobox.com>
Date:   Tue Apr 2 21:08:43 2019 +0100

    Dominosa: rewrite the solver.
    
    The new solver should be equivalent to the previous solver's
    intelligence level, but it's more usefully split up into basic
    data-structure maintenance and separate deduction routines that you
    can omit some of. So it's a better basis to build on when adding
    further deductions or dividing the existing ones into tiers.
    
    The new solver also produces much more legible diagnostics, when the
    command-line solver is run in -v mode.

 dominosa.c | 877 ++++++++++++++++++++++++++++++++++++++-----------------------
 1 file changed, 543 insertions(+), 334 deletions(-)

commit 6235f7fb3d1fd85c53ac7da9f461a6299c64ad5b
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=6235f7fb3d1fd85c53ac7da9f461a6299c64ad5b;hp=82ee3d42a4fd4907b8a4c98579d934176654eb7d
Author: Simon Tatham <anakin at pobox.com>
Date:   Tue Apr 2 21:01:36 2019 +0100

    Dominosa: introduce a difficulty system.
    
    Currently, there are just two difficulty levels. 'Basic' is the same
    as the old solver; 'Trivial' is the subset that guarantees the puzzle
    can be solved using only the two simplest deductions of all: 'this
    domino can only go in one place' and 'only one domino orientation can
    fit in this square'.
    
    The solver has also acquired a -g option, to grade the difficulty of
    an input puzzle using this system.

 dominosa.c | 148 +++++++++++++++++++++++++++++++++++++++++++------------------
 1 file changed, 105 insertions(+), 43 deletions(-)

commit 2ec6daee32ad7b2967141aa52ee3327af8055e67
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=2ec6daee32ad7b2967141aa52ee3327af8055e67;hp=6235f7fb3d1fd85c53ac7da9f461a6299c64ad5b
Author: Simon Tatham <anakin at pobox.com>
Date:   Tue Apr 2 21:32:29 2019 +0100

    Dominosa: new deduction deduce_local_duplicate().
    
    This is a reasonably simple local deduction I've been using myself for
    ages, and feel comfortable adding to the existing Basic difficulty
    level.

 dominosa.c | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 65 insertions(+), 14 deletions(-)

commit e2f52df5ec5a34ded78e95e9605c0bc810019bcd
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=e2f52df5ec5a34ded78e95e9605c0bc810019bcd;hp=2ec6daee32ad7b2967141aa52ee3327af8055e67
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Apr 3 18:16:25 2019 +0100

    Dominosa: add a Hard difficulty which can do set analysis.
    
    This is another thing I've been doing with my own brain for ages as a
    more interesting alternative to scouring the grid for the simpler
    deduction that must be there somewhere - but now the solver can
    understand it too, so it can generate puzzles that _need_ it (or at
    least need something beyond the simpler strategies it understands).

 dominosa.c | 292 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 272 insertions(+), 20 deletions(-)

commit 453a2c1ca8971cb5b2cd1aef1c5c8a2fef6d107b
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=453a2c1ca8971cb5b2cd1aef1c5c8a2fef6d107b;hp=e2f52df5ec5a34ded78e95e9605c0bc810019bcd
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Apr 3 18:26:42 2019 +0100

    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 | 41 +++++++++++++++++++++++++++++++++++------
 1 file changed, 35 insertions(+), 6 deletions(-)

commit b0c73d5c58bdd4fedd6da94cfb04e2012f47379f
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=b0c73d5c58bdd4fedd6da94cfb04e2012f47379f;hp=453a2c1ca8971cb5b2cd1aef1c5c8a2fef6d107b
Author: Simon Tatham <anakin at pobox.com>
Date:   Thu Apr 4 23:51:35 2019 +0100

    Dominosa: update the to-do list.
    
    In particular, reorganise the priorities. I think forcing chains are
    the most important thing that still wants adding; the parity search
    would be easy enough but I don't know how often it would actually be
    _useful_; the extended set analysis would be nice but I don't know how
    to make it computationally feasible.

 dominosa.c | 72 ++++++++++++++++++++++++++++++++++++++++----------------------
 1 file changed, 47 insertions(+), 25 deletions(-)



More information about the tartarus-commits mailing list