This is a command-line utility for solving, generating and testing Nonograms.
Installation depends on Binodeps and Nonogram library.
To install in /usr/local:
make
sudo make install
Override the default location by setting PREFIX.
This can be set on the command line:
make PREFIX=$HOME/.local install
…or in a local file config.mk:
PREFIX=$(HOME)/.local
…or in nonogram-env.mk, which is sought on GNU Make's search path, set by -I:
make -I$HOME/.config/local install
You probably want to set some more optimal compilation options, and find the Nonogram library, e.g., by placing them in config.mk:
CFLAGS += -O2 -g
PREFIX=$(HOME)/.local
CPPFLAGS += -I$(PREFIX)/include
LDFLAGS += -L$(PREFIX)/lib
Installation places installs the following files under $(PREFIX):
bin/nonogram
Puzzles the format defined by the Nonogram Library.
Solutions are simple text files consisting of lines of # for foreground colour and - for background colour.
The nonogram command processes switches and filenames in order.
Some switches modify a context:
-is– Read from standard input (the default).-i file– Read fromfile.-os– Write to standard output (the default).-o file– Write tofile. Multiple solutions are separated by blank lines.-on file-%d.txt– Write each solution tofile-1.txt,file-2.txt, etc.+o– Disable solution/puzzle output.-v– Clear screen and display the grid as the solution is solved. The standard error output is used.+v– Don't display the grid during solving.-Afast– Use the fast algorithm.-Acomplete– Use the slow exhaustive algorithm.-Ahybrid– Use the fast algorithm first, then the slow exhaustive one.-Afcomp– Use the fast comprehensive algorithm.-Affcomp– Use the fast algorithm, then the fast comprehensive algorithm.-Aolsak– Use the Olšáks' algorithm.-Afastolsak– Use the fast algorithm, then the Olšáks'.-Afastolsakcomplete– Use the fast algorithm, then the Olšáks', then the slow exhaustive.-Afastodd– Probably the same as-Afastolsak, butoddwas intended to diverge.-Afastoddcomplete– Probably the same as-Afastolsakcomplete.-CO,-CE– Display a count of solutions when complete, on standard output or standard error output respectively.+CO,+CE– Disable count of solutions, on standard output or standard error output respectively.-s num– Stop afternsolutions. Use-n 2to detect bad puzzles that have more than one solutions.-log file.log– Append logging information tofile.log.-nlog file.log– Overwritefile.logwith logging information.+log,+nlog– Cancel logging (default).-ll num– Set log detail tonum(default 0).-Dkey– Delete the metadata specified bykey.-Rkey value– Set or replace the metadata specified bykey.-Xkey– Print the metadata specified bykey.-W– Print the width.-H– Print the height.
Other switches act on the current context before further argument processing:
-x– Load a puzzle from the source, and solve it, writing solutions to the destination. This switch is assumed at the end if the context has changed since the last action switch.-p– Print the current context.-c– Load a puzzle, and display the sum of row clues minus the sum of column clues.-g– Load a grid from the source, stopping at end-of-file, or on first line with a different length, and write out a puzzle.
nonogram -on flower%d.txt -v -i flower.non -x
Solve flower.non, printing results in flower1.txt, flower2.txt, …, and display work.
nonogram -x < duck.non
Solve duck.non, print to stdout.
nonogram +o -v -x < duck.non
Show duck.non being solved.
Don't produce solution.
cat duck.non flower.non | nonogram +o -v -x -x
Solve two puzzles from stdin.
Display working but give no other output.