less_retarded_wiki

main page, file list (638), source, all in md+txt+html+pdf, commit RSS feed, report abuse, stats, random article, consoomer version

Nonogram

WIP

Nonogram (so named after Non Ishida but known by various other names such as griddlers, crosspix, picross etc.) is a puzzle game (somewhat remotely similar to the famous sudoku puzzle) goal of which is to reconstruct a hidden picture in a two dimensional grid according to numeric clues on the sides of the grid that for each row and column say the number of continuous colored segments the given row/column contains. The idea is similar to guessing a shape of an object from its shadow projected on two walls; we may also see it as a constraints satisfaction type of problem. Different variants of nonogram exist, for example ones that use different shapes for the grid or utilize more than just two colors; here we will primarily focus on the simple, traditional nonogram with regular two dimensional grid and two colors. Like with all similar kinds of games LRS considers nonogram a highly valued game for its simplicity, elegance, mathematical depth, independence, legal freedom (no one owns the game as such, it's in the public domain, however this won't hold for the pictures themselves), practical freedom (no computer is needed, only pen and paper) etc. It seems like the puzzle was created, or at least popularized, in 1987 in Japan.

{ Nonogram has a free, suckless implementation in Simon Tatham's Portable Puzzle Collection under the name "pattern". ~drummyfish }

Rules of the game are simple: we have a two dimensional grid, each square can be either black or white, initially all squares are white (at least in the paper version, in computer implementations the squares may be gray, meaning unknown color). The goal is to fill some squares black and so reveal a hidden picture according to clues given on the sides (usually left and top) of the grid. Each row and each column has a clue consisting of N numbers; each such clue says the lengths of continuous black-colored segments that are contained in that row/column, in that order, with at least one white square between them. For example a clue "2 3" under some column says the column from top to bottom will begin with a number (even zero) of white squares, then exactly two black squares will appear, then at least one white square and then exactly three black squares.

The fact that nonograms don't generally have a unique solution is easily exposed by a trivial example of a 2x2 grid with clue numbers 1 in each column and row: two possible solutions will satisfy these clues (a checkerboard pattern and its inversion). It appears (according to someone's 2022 master's thesis that focused solely on this problem) that deciding or even estimating the number of solutions of given nonogram is neither easy nor fast.

              1 1 1 2
          2 2 1 1 1 1
        8 2 2 1 1 1 2 6

  1 5   X   X X X X X  
  3 2   X X X       X X
  2 1   X X           X
1 1 2   X     X     X X
1 2 1   X       X X   X
  2 1   X X           X
  3 2   X X X       X X
  1 5   X   X X X X X  

SAF fish encoded as nonogram.

While constructing clues from given picture is trivial, solving nonogram is NP complete, i.e. "(probably) difficult and slow", for which very different imperfect approaches are being utilized and combined, such as DFS, genetic algorithms or neural networks. Some tips for solving (manual or automated) are these:

See Also


Powered by nothing. All content available under CC0 1.0 (public domain). Send comments and corrections to drummyfish at disroot dot org.