Optimize simulation with logic-only solver, fix rectangular grid support, and improve worker pool
All checks were successful
Deploy to Production / deploy (push) Successful in 8s

This commit is contained in:
2026-02-13 05:18:55 +01:00
parent 48def6c400
commit 2cd32d4a3e
15 changed files with 641 additions and 282 deletions

View File

@@ -0,0 +1,27 @@
import { describe, it, expect } from 'vitest';
import { solvePuzzle } from './solver';
import { calculateHints } from './puzzleUtils';
describe('Debug Solver', () => {
it('should solve the broken grid', () => {
const grid = [
[0,1,1,1,0,0,1,0,1,1],
[1,1,1,0,0,1,1,1,0,0],
[1,0,1,0,1,0,0,1,0,0],
[1,0,0,0,1,1,1,1,0,1],
[1,1,0,1,0,0,0,1,0,1],
[1,0,1,0,1,0,0,0,1,0],
[1,1,1,0,0,1,1,0,0,0],
[0,1,0,0,1,0,1,0,0,0],
[0,0,0,1,1,0,0,0,1,0],
[1,0,1,1,0,0,1,0,1,1]
];
const { rowHints, colHints } = calculateHints(grid);
const result = solvePuzzle(rowHints, colHints);
console.log('Solve Result:', result);
expect(result.percentSolved).toBe(100);
});
});