chiark / gitweb /
Tal Kelrich spotted that hitting `Solve' on a configuration which is
[sgt-puzzles.git] / blackbox.c
index 835175dbd7ef6d273b15e2e56eabe57e89171982..165ee2e67c8eb77154e171c40d6517256a020e09 100644 (file)
@@ -813,7 +813,9 @@ static int check_guesses(game_state *state, int cagey)
             ret = 0;
         }
     }
-    if (ret == 0) goto done;
+    if (ret == 0 ||
+       state->nguesses < state->minballs ||
+       state->nguesses > state->maxballs) goto done;
 
     /* fix up original state so the 'correct' balls end up matching the guesses,
      * as we've just proved that they were equivalent. */