Skip to main content

A nonogram/griddle solver that can handle multi-color puzzles

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
6 days ago (0.1.3)

Nonogram Solver

Nonogram solver algorithm used by nonochill, my nonogram puzzle generator/game (source code).

The algorithm is based on the procedure described in this article by Hennie de Harder, modified to support multiple colors in the puzzle.

I've used it to solve boards up to 20x20 with 5 colors. It currently has no ability to do a search, so fails for any puzzle that requires bifurcation.

Installation:

# deno
deno add jsr:@jzumun/nonogram-solver

#node
npx jsr add @jzumun/nonogram-solver

Usage

import { solve } from "jsr:@jzumun/nonogram-solver"

const solution = solve({
    row: [
        [{ count: 1, val: 1 }],
        [],
    ],
    column: [
        [{ count: 1, val: 1 }],
        [],
    ]
})

Add Package

deno add jsr:@jzumun/nonogram-solver

Import symbol

import * as nonogram_solver from "@jzumun/nonogram-solver";

---- OR ----

Import directly with a jsr specifier

import * as nonogram_solver from "jsr:@jzumun/nonogram-solver";

Add Package

npx jsr add @jzumun/nonogram-solver

Import symbol

import * as nonogram_solver from "@jzumun/nonogram-solver";

Add Package

yarn dlx jsr add @jzumun/nonogram-solver

Import symbol

import * as nonogram_solver from "@jzumun/nonogram-solver";

Add Package

pnpm dlx jsr add @jzumun/nonogram-solver

Import symbol

import * as nonogram_solver from "@jzumun/nonogram-solver";

Add Package

bunx jsr add @jzumun/nonogram-solver

Import symbol

import * as nonogram_solver from "@jzumun/nonogram-solver";