logic-puzzle-generator 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -63,7 +63,11 @@ class GenerativeSession {
|
|
|
63
63
|
});
|
|
64
64
|
// Sort by score descending
|
|
65
65
|
scored.sort((a, b) => b.score - a.score);
|
|
66
|
-
|
|
66
|
+
// Filter by minDeductions if provided
|
|
67
|
+
// Defaults to 0 if undefined (allow all)
|
|
68
|
+
const minDeductions = constraints?.minDeductions ?? 0;
|
|
69
|
+
const finalResults = scored.filter(s => s.deductions >= minDeductions);
|
|
70
|
+
return finalResults.slice(0, limit);
|
|
67
71
|
}
|
|
68
72
|
useClue(clue) {
|
|
69
73
|
// Ensure the clue is removed from available if it was there
|