Arguments for "nonogram"
~~~~~~~~~~~~~~~~~~~~~~~~

The program "nonogram" attempts to solve Nonogram puzzles using the
file format described on the website (an example is in utnomore.non).

A series of switches and file names are taken as arguments.  The
switch -x causes a puzzle to be loaded from a file or from the
standard input, and processed according to a context defined by other
preceding switches in the argument list.

The use of several -x switches enables several puzzles to be solved
with a single command.  If any of the switches that change the context
(-is, -i, -os, -on, -/+o, -/+v, -/+html, -/+dot, -/+solid, -/+blank)
have been used since the last -x/p/c, then a -x is appended as the
last argument.  This means you don't have to enter a trailing -x
yourself.  This facility is disabled by compiling with NOAUTOEXEC (see
INSTALL).

These switches act on the current context:

-x

  Execute.  A puzzle is loaded and solved.

-p

  Print.  Display the current context (on stderr).

-c

  Check.  Load a puzzle and check that the row sum matches the column
  sum (displaying the difference on stderr).

-g

  Generate a puzzle.  Load a grid (stopping at end of file, or first
  line with different length), and generate a puzzle (written
  according to -/+o, -os; not -on).

-W

  Extract width and write according to -/+o, -os; not -on.

-H

  Extract height and write according to -/+o, -os; not -on.

-T

  Deprecated.  Extract title and write according to -/+o, -os; not
  -on.

-Xname

  Extract line labeled 'name' and write according to -/+o, -os; not
  -on.

-Dname

  Load the puzzle, delete the line labeled 'name', and write the
  altered puzzle according to -/+o, -os; not -on.

-Rname value

  Load the puzzle, add/replace the line labeled 'name' with 'value',
  and write the altered puzzle according to -/+o, -os; not -on.

Note that when a puzzle is loaded from stdin by -x or -c, it cannot be
loaded again with a subsequent -x or -c, as such loads occur from the
last position in stdin that was read.  Files, on the other hand, are
always loaded from the beginning.

The parts of the context that can be changed by other switches are:


* Information level

-q

  Quiet: no stderr information.

+q

  Verbose: explanations on stderr.


* Input

-is

  Read puzzles from stdin (the default).

-i input

  Read a puzzle from the file "input".


* Output

-os

  Write solution/puzzle to stdout (the default).

-on out%dput

  Write each solution to "out1put" "out2put" "out3put", e.g. -on
  duck%d.txt.

+o

  Don't produce the solution/puzzle.

-o output

  Write each solution/puzzle to the file "output", separated by a
  blank line.


* Visual display

This facility is disabled by compiling with NOVISUAL (see INSTALL).

-v

  Clear screen and print the grid while it is being solved (using
  stderr).

+v

  Don't display grid as it is being solved (the default).


* Algorithm

-Afast

  Use the fast, but not thorough algorithm.

-Acomplete

  Use the slow, exhaustive algorithm.

-Ahybrid

  Use the fast algorithm first on each line, then the exhaustive
  algorithm if necessary.  This is the default.

-Afcomp

  Use the fast-complete algorithm.  It is almost as fast as 'fast',
  but is also exhaustive, which means bifurcation only happens when
  really necessary, which then gives it an edge over 'fast'.

-Affcomp

  Use 'fast' first, then 'fcomp' only if necessary.  This is the
  default, and has most of the speed of 'fast', but also avoids
  unnecessary bifurcation.

-Aolsak
-Afastolsak
-Afastolsakcomplete
-Afastodd
-Afastoddcomplete

  These are other algorithms and combinations to be experimented with.
  In fact 'odd' and 'olsak' are probably the same, but were intended
  to diverge.  They use components of 'fast', then make special
  guesses (local bifurcations) where 'fast' usually has trouble, to
  make them exhaustive.


* HTML output

-html

  Enable HTML output, using format defined by -/+table (see below).

+html

  Produce the output as plain text using single characters
  (configurable; see below) to represent dots, solids and blanks.
  This is the default context.

-table

  Produce the output as the elements of a HTML table (no leading or
  trailing <TABLE> tags).  The elements are <IMG> tags with
  configurable SRC attributes.  This is the default context.

+table

  Assume the images will fit together to make a grid (i.e. they are
  all the same size).  Lines are separated by <BR>.


* Dot/solid/blank representation

-dot dstring -solid sstring -blank bstring

  Specify the character (if +html) or image source (if -html) for each
  type of cell that may appear in a solution.


* Solution counting

-/+CO -/+CE

  Enable/disable the display of a count of solutions encountered, on
  stdout/stderr.

-s number

  Stop after the specified number of solutions.

+s

  Stop only when all solutions have been obtained.


* Miscellaneous

-h

  Print summary of switches.

-log logfile

  Append logging information to logfile.

+log

  Cancel output of logging information (default).

-ll number

  Set the level of detail for logs (default 0).

-O

  Display compilation options.

-title string

  Set title of puzzle for -g.


Example commands
~~~~~~~~~~~~~~~~

% 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 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.
