+ int i, j, n;
+ struct numberdata *nd;
+
+ /*
+ * Attempt the in-built solver.
+ */
+
+ /* Set up each number's (very short) candidate position list. */
+ for (i = n = 0; i < state->h * state->w; i++)
+ if (state->grid[i])
+ n++;
+
+ nd = snewn(n, struct numberdata);
+
+ for (i = j = 0; i < state->h * state->w; i++)
+ if (state->grid[i]) {
+ nd[j].area = state->grid[i];
+ nd[j].npoints = 1;
+ nd[j].points = snewn(1, struct point);
+ nd[j].points[0].x = i % state->w;
+ nd[j].points[0].y = i / state->w;
+ j++;
+ }
+
+ assert(j == n);
+
+ ret = dup_game(state);
+ ret->cheated = TRUE;
+
+ rect_solver(state->w, state->h, n, nd, ret, NULL);
+
+ /*
+ * Clean up.
+ */
+ for (i = 0; i < n; i++)
+ sfree(nd[i].points);
+ sfree(nd);
+
+ return ret;