simon-git: puzzles (master): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Fri Apr 5 19:44:39 BST 2019
TL;DR:
5c4d6b8 New utility routine: sort with a context parameter.
7f00725 Fix a handful of memory leaks in the midend.
191843e Dominosa: add an Extreme difficulty, with forcing chains.
97a36f1 Dominosa: prevent hangs generating tiny hard puzzles.
a2b70e2 Dominosa: add presets for Hard and Extreme difficulty.
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 19:44:39
commit 5c4d6b8f35e749b269907fd2cdaacc117198807b
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=5c4d6b8f35e749b269907fd2cdaacc117198807b;hp=b0c73d5c58bdd4fedd6da94cfb04e2012f47379f
Author: Simon Tatham <anakin at pobox.com>
Date: Fri Apr 5 19:23:21 2019 +0100
New utility routine: sort with a context parameter.
I'm about to have a need to sort an array based on auxiliary data held
in a variable that's not globally accessible, so I need a sort routine
that accepts an extra parameter and passes it through to the compare
function.
Sorting algorithm is heapsort, because it's the N log N algorithm I
can implement most reliably.
puzzles.h | 14 ++++++
sort.c | 160 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 174 insertions(+)
commit 7f00725c978bf79de91951f143cdfd2f9173041d
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=7f00725c978bf79de91951f143cdfd2f9173041d;hp=5c4d6b8f35e749b269907fd2cdaacc117198807b
Author: Simon Tatham <anakin at pobox.com>
Date: Fri Apr 5 19:29:23 2019 +0100
Fix a handful of memory leaks in the midend.
I happened to notice these when running dominosa --generate under Leak
Sanitiser.
midend.c | 7 +++++++
1 file changed, 7 insertions(+)
commit 191843e0c71da265df20e387913c22900b2b8ca7
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=191843e0c71da265df20e387913c22900b2b8ca7;hp=7f00725c978bf79de91951f143cdfd2f9173041d
Author: Simon Tatham <anakin at pobox.com>
Date: Fri Apr 5 19:40:42 2019 +0100
Dominosa: add an Extreme difficulty, with forcing chains.
This technique borrows its name from the Solo / Map deduction in which
you find a path of vertices in your graph each of which has two
possible values, such that a choice for one end vertex of the chain
forces everything along it. In Dominosa, an approximate analogue is a
path of squares each of which has only two possible domino placements
remaining, and it has the extra-useful property that it's
bidirectional - once you've identified such a path, either all the odd
domino placements along it must be right, or all the even ones. So if
you can find an inconsistency in either set, you can rule out the
whole lot and settle on the other set.
Having done that basic analysis (which turns out to be surprisingly
easy with an edsf to help), there are multiple ways you can actually
rule out one of the same-parity chains. One is if the same domino
would have to appear twice in it; another is if the set of dominoes
that the chain would place would rule out all the choices for some
completely different square. There are probably others too, but those
are the ones I've implemented.
dominosa.R | 2 +-
dominosa.c | 284 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
2 files changed, 272 insertions(+), 14 deletions(-)
commit 97a36f1cd2fd285235afb2e6bcea3b6fa74cef40
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=97a36f1cd2fd285235afb2e6bcea3b6fa74cef40;hp=191843e0c71da265df20e387913c22900b2b8ca7
Author: Simon Tatham <anakin at pobox.com>
Date: Fri Apr 5 19:40:59 2019 +0100
Dominosa: prevent hangs generating tiny hard puzzles.
As with several other puzzles, the harder difficulty levels turn out
to be impossible to generate at very small sizes, which I fudge by
replacing them with the hardest level actually feasible.
dominosa.c | 25 ++++++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)
commit a2b70e2a6e90819df09812e96b153b1f6a408cde
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=a2b70e2a6e90819df09812e96b153b1f6a408cde;hp=97a36f1cd2fd285235afb2e6bcea3b6fa74cef40
Author: Simon Tatham <anakin at pobox.com>
Date: Fri Apr 5 19:41:38 2019 +0100
Dominosa: add presets for Hard and Extreme difficulty.
I decided not to go all the way up to order-9 Extreme, because that
takes a lot of CPU to generate. People can select it by hand if they
don't mind that.
dominosa.c | 2 ++
1 file changed, 2 insertions(+)
More information about the tartarus-commits
mailing list