Skip to content

sondregj/hitori

Repository files navigation

🧩

Hitori

A Hitori puzzle solver

Travis Build Status npm (latest) npm bundle size GitHub contributors License Gitmoji

A simple Hitori solver, implemented with TypeScript.

Usage

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.

License

MIT © 2019 Sondre Gjellestad