A simple Hitori solver, implemented with TypeScript.
import { HitoriBoard, solve } from 'hitori'
const board = HitoriBoard.from2DArray([
[1, 4, 2, 5, 3],
[4, 3, 1, 4, 6],
[3, 5, 5, 3, 5],
[4, 2, 4, 6, 1],
[6, 4, 2, 1, 2],
])
const [solved, iterations] = solve({ board })
The solver function returns an array with the final solution, if found, and an array of all the intermediate iterations.
MIT © 2019 Sondre Gjellestad