diff options
| author | Simon Tatham <anakin@pobox.com> | 2017-09-23 19:22:37 +0100 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2017-09-23 19:24:16 +0100 |
| commit | ff218728c6953ede1957ddb5b039bcb2ba920a44 (patch) | |
| tree | e02d2701b8ec37c234de603ffa8d1595114d050b /loopy.c | |
| parent | b8313181a6104624000e9cc008e8e26b67aeb655 (diff) | |
| download | puzzles-ff218728c6953ede1957ddb5b039bcb2ba920a44.zip puzzles-ff218728c6953ede1957ddb5b039bcb2ba920a44.tar.gz puzzles-ff218728c6953ede1957ddb5b039bcb2ba920a44.tar.bz2 puzzles-ff218728c6953ede1957ddb5b039bcb2ba920a44.tar.xz | |
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.
Diffstat (limited to 'loopy.c')
0 files changed, 0 insertions, 0 deletions