simon-git: puzzles (master): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Sat Sep 23 19:40:42 BST 2017
TL;DR:
b831318 Pattern: missing special case in the solver.
ff21872 Pattern: randomise rounding bias in generate().
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: 2017-09-23 19:40:42
commit b8313181a6104624000e9cc008e8e26b67aeb655
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=b8313181a6104624000e9cc008e8e26b67aeb655;hp=61e711178455dbd0ec8f78d15791b7e25fbf7156
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Sep 23 19:17:36 2017 +0100
Pattern: missing special case in the solver.
We were filling in a row immediately as all-white if it had no clues
at all, but weren't filling in a row as all-black if it had a single
clue covering the entire row. Now we do both.
In particular, this caused the Pattern solver to be unable to take
advantage of one of the two kinds of totally obvious clue across the
_easy_ dimension of a trivial 1xN puzzle - and a special case of
_that_, as a user pointed out, is that the game generator hangs trying
to create a 1x1 puzzle, which ought to be the easiest thing in the
world!
pattern.c | 2 ++
1 file changed, 2 insertions(+)
commit ff218728c6953ede1957ddb5b039bcb2ba920a44
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=ff218728c6953ede1957ddb5b039bcb2ba920a44;hp=b8313181a6104624000e9cc008e8e26b67aeb655
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Sep 23 19:22:37 2017 +0100
Pattern: randomise rounding bias in generate().
Now, with an odd grid size, we choose the posterisation threshold so
that half the time it delivers ceil(n/2) black squares and half the
time it delivers floor(n/2). Previously it only did the former, which
meant that asking Pattern to generate a 1x1 puzzle (with the bug in
the previous commit fixed) would always generate the one with a single
black square, and never the one with a single white square. Both are
trivial to solve, of course, but it seemed inelegant!
No change to the number of black squares in the puzzle solution can
constitute a spoiler for the player, of course, because that number is
trivial to determine without doing any difficult reasoning, just by
adding up all the clues in one dimension.
pattern.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
More information about the tartarus-commits
mailing list