feat: expand sudoku analysis and interoperability
This commit is contained in:
@@ -38,6 +38,28 @@ describe("logical solver", () => {
|
||||
expect(result.steps).toHaveLength(1);
|
||||
});
|
||||
|
||||
it("does not apply positive cage reductions to a false cage", () => {
|
||||
const result = solveLogically({
|
||||
version: 1,
|
||||
size: 4,
|
||||
givens: Array<number>(16).fill(0),
|
||||
regions: classicRegions(4),
|
||||
constraints: [
|
||||
{
|
||||
type: "killer-cage",
|
||||
cells: [0, 1],
|
||||
sum: 3,
|
||||
noRepeat: false,
|
||||
negated: true,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
expect(result.status).toBe("stuck");
|
||||
expect(result.steps).toEqual([]);
|
||||
expect(result.candidates[0]).toEqual([1, 2, 3, 4]);
|
||||
});
|
||||
|
||||
it("returns bounded killer combinations", () => {
|
||||
expect(
|
||||
killerDigitCombinations({ size: 9, count: 2, sum: 10 }).combinations,
|
||||
|
||||
Reference in New Issue
Block a user