shithub: puzzles

Download patch

ref: 5e22080bcd581fe4e2a07ca897ebea19a2961f66
parent: 21b8323b2f1ca7b6bf01bc1e7a529636ea57daba
author: Jonas Kölker <jonaskoelker@yahoo.com>
date: Thu Oct 1 14:47:55 EDT 2015

Improve Towers error highlighting.

Highlight clues of value n in Towers if its row/column contains an
increasing sequence of length n, the last number of which is not equal
to the number of rows/columns (i.e. such that the sequence will have
to be extended, in violation of the clue).

--- a/towers.c
+++ b/towers.c
@@ -1248,7 +1248,8 @@
 	    }
 	}
 
-	if (n > clues[i] || (j == w && n < clues[i])) {
+	if (n > clues[i] || (best == w && n < clues[i]) ||
+	    (best < w && n == clues[i])) {
 	    if (errors) {
 		int x, y;
 		CLUEPOS(x, y, i, w);