+ /* Redraw clue colours if necessary */
+ for (j = 0; j < h; ++j) {
+ for (i = 0; i < w; ++i) {
+ c[0] = CLUE_AT(state, i, j);
+ c[1] = '\0';
+ if (c[0] == ' ')
+ continue;
+
+ n = c[0] - '0';
+ assert(n >= 0 && n <= 4);
+
+ clue_mistake = (square_order(state, i, j, LINE_YES) > n ||
+ square_order(state, i, j, LINE_NO ) > (4-n));
+
+ if (clue_mistake != ds->clue_error[i * w + j]) {
+ draw_rect(dr,
+ BORDER + i * TILE_SIZE + CROSS_SIZE,
+ BORDER + j * TILE_SIZE + CROSS_SIZE,
+ TILE_SIZE - CROSS_SIZE * 2, TILE_SIZE - CROSS_SIZE * 2,
+ COL_BACKGROUND);
+ draw_text(dr,
+ BORDER + i * TILE_SIZE + TILE_SIZE/2,
+ BORDER + j * TILE_SIZE + TILE_SIZE/2,
+ FONT_VARIABLE, TILE_SIZE/2,
+ ALIGN_VCENTRE | ALIGN_HCENTRE,
+ clue_mistake ? COL_MISTAKE : COL_FOREGROUND, c);
+ draw_update(dr, i * TILE_SIZE + BORDER, j * TILE_SIZE + BORDER,
+ TILE_SIZE, TILE_SIZE);
+
+ ds->clue_error[i * w + j] = clue_mistake;
+ }
+ }
+ }
+
+ /* I've also had a request to colour lines red if they make a non-solution
+ * loop, or if more than two lines go into any point. I think that would
+ * be good some time. */
+