All checks were successful
Deploy to Production / deploy (push) Successful in 8s
28 lines
833 B
JavaScript
28 lines
833 B
JavaScript
|
|
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);
|
|
});
|
|
});
|