+ *
+ * The contents of ctx->iscratch are completely different
+ * depending on whether diff == DIFF_HARD or not. This function
+ * uses iscratch completely differently between the two cases, and
+ * the code in solver_common() which consumes the result must
+ * likewise have an if statement with completely different
+ * branches for the two cases.
+ *
+ * In DIFF_EASY and DIFF_NORMAL modes, the valid entries in
+ * ctx->iscratch are 0,...,n-1, and each of those entries
+ * ctx->iscratch[i] gives a bitmap of the possible digits in the
+ * ith square of the clue box currently under consideration. So
+ * each entry of iscratch starts off as an empty bitmap, and we
+ * set bits in it as possible layouts for the clue box are
+ * considered (and the difference between DIFF_EASY and
+ * DIFF_NORMAL is just that in DIFF_EASY mode we deliberately set
+ * more bits than absolutely necessary, hence restricting our own
+ * knowledge).
+ *
+ * But in DIFF_HARD mode, the valid entries are 0,...,2*w-1 (at
+ * least outside *this* function - inside this function, we also
+ * use 2*w,...,4*w-1 as scratch space in the loop below); the
+ * first w of those give the possible digits in the intersection
+ * of the current clue box with each column of the puzzle, and the
+ * next w do the same for each row. In this mode, each iscratch
+ * entry starts off as a _full_ bitmap, and in this function we
+ * _clear_ bits for digits that are absent from a given row or
+ * column in each candidate layout, so that the only bits which
+ * remain set are those for digits which have to appear in a given
+ * row/column no matter how the clue box is laid out.