simon-git: puzzles (master): Simon Tatham

Commits to Tartarus CVS repository. tartarus-commits at lists.tartarus.org
Sun Dec 28 14:29:38 GMT 2014


TL;DR:
  546fbe6 Error-highlight loops in Net.

Repository:     git://git.tartarus.org/simon/puzzles.git
On the web:     http://tartarus.org/~simon-git/gitweb/?p=puzzles.git
Branch updated: master
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2014-12-28 14:29:38

commit 546fbe6774ce4c8b630f33a341963a77e1e151e4
web diff http://tartarus.org/~simon-git/gitweb/?p=puzzles.git;a=commitdiff;h=546fbe6774ce4c8b630f33a341963a77e1e151e4;hp=822243de1bc1fc6d26b2f2d0f45616c8f6183058
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Dec 28 12:19:50 2014 +0000

    Error-highlight loops in Net.
    
    Loops are detected using the same dsf technique I ended up using in
    Slant, and highlighted in red (whether or not the connected component
    they belong to is currently powered).
    
    Should make life a little bit easier for someone who's filled in most
    of the grid to a nice uniform cyan and finds one piece left over - now
    they have some idea where to start looking for their mistake.
    
    We also take care not to generate any loops in the starting position,
    on grounds of politeness (don't accuse the user of a mistake before
    they've even had a chance to make one).
    
    Loop detection does not contribute to the code that decides whether
    the puzzle is complete, because there's no need - if all squares are
    connected together, then there can't be any loops anyway, by graph
    theory.

 net.c |  185 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 173 insertions(+), 12 deletions(-)



More information about the tartarus-commits mailing list