simon-git: puzzles (master): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Sun Mar 12 09:25:57 GMT 2017


TL;DR:
  0bcb32c Net: fix completion check if top left square is empty.

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-03-12 09:25:57

commit 0bcb32c9132020ffe2985b542951b05c6ab58b2a
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=0bcb32c9132020ffe2985b542951b05c6ab58b2a;hp=1f613ba31f2599bf29c35d5a46cc81594f6844ea
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Mar 12 09:11:43 2017 +0000

    Net: fix completion check if top left square is empty.
    
    A hand-typed grid is permitted to use the square type '0' (never
    generated by Net's own grid generator), which is a completely empty
    square. This requires an adjustment to the completion checker, so that
    such squares aren't required to be connected; otherwise, a grid
    containing one would be permanently uncompletable.
    
    However, the completion checker missed one case - it was
    unconditionally checking that all squares are connected to the _top
    left corner_, on the basis that (before I thought of the zero square)
    any source square is as good as any other if what you really want to
    know is whether they're all connected to each other. But that means
    that if the top left square _is_ the empty one, things to wrong - e.g.
    5x5:02c328ade11adb129d7c3e524 would fail to give a completion flash.
    
    Fixed by starting the completion-checking search from the first
    non-empty square we find.

 net.c | 31 +++++++++++++++++++------------
 1 file changed, 19 insertions(+), 12 deletions(-)



More information about the tartarus-commits mailing list