import { print, Sudoku } from "https://esm.town/v/saolsen/sudoku";
import { solve as brute_force_solve } from "https://esm.town/v/saolsen/sudoku_solver_brute_force";
import { solve as exact_cover_solve } from "https://esm.town/v/saolsen/sudoku_solver_exact_cover";
const sudoku: Sudoku = [
[0, 0, 0, 0, 0, 0, 1, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 6],
[0, 0, 0, 0, 0, 7, 0, 3, 8],
[0, 0, 0, 2, 9, 0, 4, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 2, 0],
[0, 0, 2, 0, 0, 5, 0, 0, 0],
[0, 0, 0, 3, 1, 0, 0, 0, 0],
[0, 1, 6, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 9, 0, 0, 6, 0, 0],
];
const bfs = brute_force_solve(sudoku);
console.assert(JSON.stringify(bfs) !== null);
console.log("BFS solution");
print(bfs);
const ecs = exact_cover_solve(sudoku);
console.assert(JSON.stringify(ecs) !== null);
console.log("ECS solution");
print(ecs);