From: Simon Tatham Date: Thu, 28 Apr 2016 19:42:23 +0000 (+0100) Subject: Account for disconnected paths in Loopy and Pearl error highlights. X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=b31155b732c1bab2e744a0ebf7532af2de2ce4a5;hp=b31155b732c1bab2e744a0ebf7532af2de2ce4a5;p=sgt-puzzles.git Account for disconnected paths in Loopy and Pearl error highlights. In commits 24848706e and adc54741f, I revamped the highlighting of erroneous connected components of those two puzzles' solution graphs in cases where a non-solution loop existed, so that the largest component was considered correct and the smaller ones lit up in red. I intended this to work in the cases where you have most of a correct solution as one component and a small spurious loop as another (in which case the latter lights up red), or conversely where your mostly correct component was joined into a loop leaving a few edges out (in which case the left-out edges again light up red). However, a user points out that I overlooked the case where your mostly correct solution is not all one component! If you've got lots of separate pieces of path, and one tiny loop that's definitely wrong, it's silly to light up all but the longest piece of path as if they're erroneous. Fixed by treating all the non-loop components as one unit for these purposes. So if there is at least one loop and it isn't the only thing on the board, then we _either_ light up all loops (if they're all smaller than the set of non-loop paths put together), _or_ light up everything but the largest loop (if that loop is the biggest thing on the board). ---