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
All checks were successful
Deploy to Production / deploy (push) Successful in 8s
This commit is contained in:
27
src/utils/debug_solver.test.js
Normal file
27
src/utils/debug_solver.test.js
Normal 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);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user