[dslinux-commit-bounces at dslinux.in-berlin.de: Auto-discard notification]

Stefan Sperling stsp at stsp.in-berlin.de
Sun Nov 12 10:27:08 CET 2006


----- Forwarded message from dslinux-commit-bounces at dslinux.in-berlin.de -----

Subject: Auto-discard notification
From: dslinux-commit-bounces at dslinux.in-berlin.de
To: dslinux-commit-owner at dslinux.in-berlin.de
Date: Sun, 12 Nov 2006 02:41:40 +0100

The attached message has been automatically discarded.
From: cayenne <dslinux_cayenne at user.in-berlin.de>
To: diegoesep at yahoo.fr, thechuckster at gmail.com, kineox at gmail.com,
	BThaeler at aol.com, dslinux-commit at dslinux.in-berlin.de
Subject: dslinux/user/games/sudoku CHANGES Makefile Makefile.msc README
	sudoku.6 sudoku.c sudoku.html template
Date: Sun, 12 Nov 2006 01:41:35 +0000
X-Mailer: Python syncmail $Revision: 2.1 $
	<http://sf.net/projects/cvs-syncmail>
X-Spam-Score: * (1.7) ALL_TRUSTED,BAYES_99

Update of /cvsroot/dslinux/dslinux/user/games/sudoku
In directory antilope:/tmp/cvs-serv3889

Added Files:
	CHANGES Makefile Makefile.msc README sudoku.6 sudoku.c 
	sudoku.html template 
Log Message:
adding pristine copy of sudoku to HEAD so I can branch from it

--- NEW FILE: CHANGES ---
1.0.1
    - added '-r' and '-t' options.


--- NEW FILE: template ---
%
*.**.**.*
..**.**..
.*...*..*
*...*.**.
.*.....*.
.**.*...*
*..*...*.
..**.**..
*.**.**.*
%
*.*....**
...**...*
***.*...*
...*...**
*.**.**.*
**...*...
*...*.***
*...**...
[...2571 lines suppressed...]
%
*..**....
*...*.**.
.*...*...
*.....***
...*.*...
***.....*
...*...*.
.**.*...*
....**..*
%
*......*.
*..*.**..
.....*.**
***..*...
..*...*..
...*..***
**.*.....
..**.*..*
.*......*

--- NEW FILE: sudoku.html ---
<HTML>
<HEAD>
<TITLE>Sudoku Manual Page</TITLE>
</HEAD>
<BODY>
<PRE>

</PRE>
<H2>SYNOPSIS</H2><PRE>
       (play the game)
	      <B>sudoku</B> [<I>options</I>] ...  [<I>&lt;filename&gt;</I>]

       (generate boards)
	      <B>sudoku</B> <B>-g</B> [<I>&lt;num&gt;</I>] [<I>options</I>] ...

       (solve boards)
	      <B>sudoku</B> <B>-v</B> [<I>options</I>] ...

       (calculate statistics)
	      <B>sudoku</B> <B>-s</B> [<I>options</I>] ...


</PRE>
<H2>DESCRIPTION</H2><PRE>
       The  <B>sudoku</B> board game is played on a 9x9 grid, divided into rows, col-
       umns, and 9 blocks of 3x3 squares. The objective is to fill  the  empty
       squares	with  the digits 1-9, so that each row, column, and block con-
       tains each of the digits 1-9 (and hence, it is  not  possible  for  any
       digit to appear twice in the same row, column or block).


</PRE>
<H2>EXAMPLE</H2><PRE>
       Consider the following board, and the squares marked `<I>a</I>'-`<I>h</I>' and `<I>x</I>':

	 5 . <I>a</I> | 6 <I>b</I> 1 | . . .	     The digits appearing in each of the
	 7 9 . | . . . | <I>c</I> 6 8	     squares `<I>a</I>'-`<I>h</I>' can be uniquely
	 <I>d</I> 3 . | . 8 . | 7 . .	     determined. For example, the value
	-------+-------+-------      at `<I>a</I>' must be 8, since an 8 appears
	 . 5 . | 4 1 <I>e</I> | . . 2	     in the other rows and columns of the
	 . . 1 | <I>f</I> <I>x</I> . | 6 . .	     block. Using similar logic, it must
	 8 . . | . 3 7 | . 4 .	     be true that:
	-------+-------+------- 	  <I>b</I> = 7        <I>f</I> = 8
	 . . 4 | . 9 . | <I>g</I> 2 .		  <I>c</I> = 1        <I>g</I> = 8
	 2 8 <I>h</I> | . . . | . 9 7		  <I>d</I> = 1        <I>h</I> = 5
	 . . . | 5 <I>i</I> 8 | . . 6		  <I>e</I> = 6        <I>i</I> = 2

       In  contrast, it is not possible to uniquely determine the value of `<I>x</I>'
       with the given information - it could take either the value 2 or 5.

       The board now contains the squares:

	 5 . 8 | 6 7 1 | . . .	  It is now possible to determine the values
	 7 9 . | . . . | 1 6 8	  appearing in other empty squares.
	 1 3 . | . 8 . | 7 . .
	-------+-------+-------
	 . 5 . | 4 1 6 | . . 2
	 . . 1 | 8 <I>x</I> . | 6 . .	  &lt;&lt;< the value of <I>x</I> must now be 5.
	 8 . . | . 3 7 | . 4 .
	-------+-------+-------
	 . . 4 | . 9 . | 8 2 .
	 2 8 5 | . . . | . 9 7
	 . . . | 5 2 8 | . . 6

       Repeating this process a few more times reveals the solution:

	 5 4 8 | 6 7 1 | 2 3 9
	 7 9 2 | 3 4 5 | 1 6 8
	 1 3 6 | 9 8 2 | 7 5 4
	-------+-------+-------
	 3 5 7 | 4 1 6 | 9 8 2
	 4 2 1 | 8 5 9 | 6 7 3
	 8 6 9 | 2 3 7 | 5 4 1
	-------+-------+-------
	 6 1 4 | 7 9 3 | 8 2 5
	 2 8 5 | 1 6 4 | 3 9 7
	 9 7 3 | 5 2 8 | 4 1 6


</PRE>
<H2>GAME INTERFACE</H2><PRE>
       The <B>sudoku</B> game has  a  simple  text  interface	(using	the  <B>curses(3)</B>
       library).  The  board  is  displayed in the middle of the screen, along
       with a summary of the allowed key presses.  The	cursor	can  be  moved
       around  the  board  using the arrow keys or the standard <B>vi(1)</B> movement
       keys, and each square (except for the fixed board squares that are ini-
       tially  revealed)  can  be  set to a given digit by pressing the corre-
       sponding number key, or cleared by  pressing  either  the  `<I>0</I>'  or  `<I>.</I>'
       keys.

   <B>Generating</B> <B>a</B> <B>New</B> <B>Board</B>
       A  new  board can be generated at any time by pressing the `<I>n</I>' key, and
       either a <I>precanned</I> or randomly generated board will be  displayed.   If
       the  <B>-n</B>	command line option is set, then only <I>precanned</I> boards will be
       displayed.

   <B>Entering</B> <B>a</B> <B>Custom</B> <B>Board</B>
       A custom board (e.g. found on the internet, or published in  a  newspa-
       per)  can  be entered into the game by first clearing the current board
       (press the `<I>c</I>' key), entering the published squares (using  the	cursor
       motion  keys and entering the appropriate numbers), and then fixing the
       squares by pressing the `<I>f</I>' key. At this  point,  the  entered  squares
       will be fixed (and cannot be changed).

   <B>Hints</B>
       The interactive game provides a simple hint mechanism to provide assis-
       tance in solving the board. It attempts to highlight areas of the board
       where  moves  can  be made. If repeated hints are requested, the system
       starts revealing the digit that can be placed on the board.

       Often the hints can be quite cryptic. For example, consider  the  board
       below:

	   v v v

	   . . 7 | . . <B>9</B> | . . .
	   <B>9</B> . <B>6</B> | 7 <B>4</B> . | . <B>1</B> <B>5</B>
	   . . <B>2</B> | <B>5</B> <B>1</B> . | . . .
	  -------+-------+-------
	&gt;  <B>6</B> . <B>5</B> | . 7 . | . . <B>8</B>  &lt;    <I>The</I> <I>characters</I> <I>&gt;&lt;v^</I> <I>highlight</I> <I>the</I>
	&gt;  . <B>7</B> . | . . . | . <B>3</B> .  &lt;    <I>area</I> <I>of</I> <I>the</I> <I>hint</I>
	&gt;  <B>8</B> . . | . . . | <B>7</B> . <B>6</B>  &lt;
	  -------+-------+-------
	   . . . | . <B>6</B> <B>7</B> | <B>8</B> . .
	   <B>7</B> <B>4</B> . | . <B>5</B> . | <B>9</B> 6 <B>2</B>
	   . 6 . | <B>4</B> . . | . . .

	   ^ ^ ^

       The  system  gives  the hint `<I>try</I> <I>the</I> <I>digit</I> <I>3</I>', but it is certainly not
       obvious, with the revealed squares, where the 3 goes.


</PRE>
<H2>OPTIONS</H2><PRE>
       <B>-d</B>     Describe the moves needed to solve the board. Can only  be  used
	      with the <B>-v</B> option for solving <I>precanned</I> boards.

       <B>-f</B><I>&lt;format&gt;</I>
	      Set output format. The supported formats are:
		<B>standard</B>  Default text format; <B>std</B> is a shortcut.
		<B>compact</B>   Compact text format.
		<B>csv</B>	  Comma separated values, suitable for importing
			  into a spreadsheet.
		<B>postscriptps</B> is a shortcut.
		<B>html</B>	  Simple HTML.

       <B>-g</B><I>[&lt;num&gt;]</I>
	      Generate	<I>&lt;num&gt;</I>  boards  (or just 1 board, if not specified) and
	      write them to standard output.

       <B>-n</B>     No random boards generated in the interactive game. Requires the
	      optional file of <I>precanned</I> boards to be specified.

       <B>-r</B>     Run in restricted mode, disallowing any games to be saved.

       <B>-s</B>     Calculate  statistics  for  the <I>precanned</I> boards, and attempt to
	      classify the difficulty of solving the boards. Can be used  with
	      the <B>-v</B> option.

       <B>-t</B><I>&lt;filename&gt;</I>
	      Set  the template file. The file set on the command line will be
	      used instead of the default template file.

       <B>-v</B>     Solve <I>precanned</I> boards, writing the solution to standard output.

       <I>&lt;filename&gt;</I>
	      Name of the optional file containing <I>precanned</I> boards.


</PRE>
<H2>ENVIRONMENT</H2><PRE>
       No environment variables are used directly by the <B>sudoku</B> program.


</PRE>
<H2>FILES</H2><PRE>
       <B>/usr/lib/sudoku/template</B>
	      Template file for generating new sudoku boards.

       <B>/usr/lib/sudoku/precanned</B>
	      Optional file, containing `precanned' sudoku boards.


</PRE>
<H2>FILE FORMATS</H2><PRE>
   <B>/usr/lib/sudoku/template</B>
       The  template  file  contains  a sequence of patterns that are used for
       generating new <B>sudoku</B> boards. Each pattern is started by a line with  a
       leading	`%'  character,  and  consists of 9 lines of 9 characters. The
       character `.' represents a square that  is  initially  blank,  and  the
       character  `*'  represents a square with a digit that is initially dis-
       played.

   <B>Compact</B> <B>text</B> <B>format</B>
       This format is similar to that of the template file, but contains  rep-
       resentations  of  game  boards.	Each board is started by a line with a
       leading `%' character, followed by an optional title for the board that
       is  displayed when the game is played. This is followed by 9 lines of 9
       characters, where the  character  `.'  represents  an  initially  empty
       square,	and  the  characters  `1'-`9'  give the value of a fixed board
       square that is initially displayed. The <B>sudoku</B> program  can  read  pre-
       canned  files  in  this	format, and will write them when the <B>-fcompact</B>
       option is set.

   <B>Standard</B> <B>text</B> <B>format</B>
       This format is very similar to the compact text	format,  but  includes
       additional  characters  to  delimit the blocks in the board. The <B>sudoku</B>
       program can read precanned files in this format,  and  writes  them  by
       default, unless another output format is set by the <B>-f</B> option.

   <B>Comma</B> <B>separated</B> <B>text</B> <B>format</B>
       This  format  is useful for importing <B>sudoku</B> boards into a spreadsheet.
       It represents each board by 9 lines of  comma  separated  fields.  Each
       field  is  blank,  or contains a digit.	The <B>sudoku</B> program cannot read
       precanned files in this format, and writes them when the  <B>-fcsv</B>	option
       is set. Unlike the standard or compact text formats, there are no lines
       separating boards, and hence, it is really only feasible to  store  one
       board per file.

   <B>Postscript</B> <B>format</B>
       This  format  is useful for printing out <B>sudoku</B> boards. The <B>sudoku</B> pro-
       gram cannot read boards stored in this format, and writes them when the
       <B>-fpostscript</B>  option  is  set. Unlike the standard or compact text for-
       mats, it is not possible to store multiple boards in the same file.

   <B>HTML</B> <B>format</B>
       This format is useful for printing out <B>sudoku</B> boards. The  <B>sudoku</B>  pro-
       gram cannot read boards stored in this format, and writes them when the
       <B>-fhtml</B> option is set. Unlike the standard or compact text  formats,  it
       is not possible to store multiple boards in the same file.


</PRE>
<H2>SEE ALSO</H2><PRE>
       There  are  a  large  number of websites dedicated to the <B>sudoku</B> puzzle
       that can be found easily using a search engine.	Some  of  these  sites
       provide	game  boards that can be challenging to solve, and others pro-
       vide strategies for finding moves.


</PRE>
<H2>DIAGNOSTICS</H2><PRE>
       There are limited diagnostics available when an error occurs.


</PRE>
<H2>ACKNOWLEDGEMENTS</H2><PRE>
       Mark Foreman for the HTML output format; Joanna Ferris and Heather  for
       encouraging this endeavour.


</PRE>
<H2>AUTHOR</H2><PRE>
       Michael Kennett (mike at laurasia.com.au)


</PRE>
<H2>COPYRIGHT</H2><PRE>
       This  manual  page, and all associated files, have been placed into the
       public domain by Michael Kennett, July 2005. They may be used  by  any-
       body  for  any  purpose	whatsoever,  however <B>NO</B> <B>WARRANTY</B>, of any sort,
       applies to this work.

</PRE>
<HR>
</BODY>
</HTML>

--- NEW FILE: README ---
LICENSE: This work has been placed into the Public Domain by Michael
Kennett (July 2005), and may be freely used by anybody for any purpose
whatsoever. No warranty, of any kind, applies to this work.

** Sudoku Installation Notes (Unix/Minix)

As the root user, or with the appropriate permissions, type:

    $ make install

This will compile and install the sudoku program into /usr/bin,
install the manpage into /usr/man/man6, and the template file
into /usr/lib/sudoku. It is necessary to edit the Makefile if
you want to install the program into a different location, or
on some systems, to set an alternative path for the man page.

Under Minix it is recommended that /etc/termcap be edited to
add 'bell' capability (see termcap(5)). This can be done by
adding a record for 'bl' in the minix console entry:

    mx|minix|minix console:\
        :am:xn:bs:\
        :co#80:li#25:\
        :bl=^G:\                       <<<< ADD THIS
        :is=\E[0m:\
        :cd=\E[0J:cl=\E[H\E[0J:\
    [etc...]

** Sudoku Installation Notes (Windows)

The source distribution provides Microsoft Visual Studio (v6) project
files, along with a simple NMAKE makefile suitable for the Microsoft
compilers. The distribution does not include makefiles for other
compilers (e.g. Borland, Open Watcom, etc...), but you should have no
difficulty in using these compilers.

The Microsoft Visual Studio files are contained in the VC6 subdirectory,
and the workspace file is VC6\sudoku.dsw. Open the workspace, and compile
the project.

Alternatively, from the command line, enter:

    > nmake /f Makefile.msc

to build the program.

Note that there is no install script for the Windows distribution, and
the program is configured to search for the template file, at runtime,
in the current working directory of the process.


--- NEW FILE: Makefile.msc ---
# Microsoft NMAKE Makefile

DEFINES=-DTEMPLATE=\"template\" -DPRECANNED=\"precanned\"

sudoku: sudoku.c win32\curses.c win32\termios.c win32\unistd.c
	$(CC) /Iwin32 $(DEFINES) $**

clean:
	del /F sudoku.exe *.obj


--- NEW FILE: sudoku.c ---
/* sudoku.c - sudoku game
 *
 * Writing a fun Su-Do-Ku game has turned out to be a difficult exercise.
 * The biggest difficulty is keeping the game fun - and this means allowing
 * the user to make mistakes. The game is not much fun if it prevents the
 * user from making moves, or if it informs them of an incorrect move.
 * With movement constraints, the 'game' is little more than an automated
 * solver (and no fun at all).
 *
 * Another challenge is generating good puzzles that are entertaining to
 * solve. It is certainly true that there is an art to creating good
 * Su-Do-Ku puzzles, and that good hand generated puzzles are more
 * entertaining than many computer generated puzzles - I just hope that
 * the algorithm implemented here provides fun puzzles. It is an area
 * that needs work. The puzzle classification is very simple, and could
 * also do with work. Finally, understanding the automatically generated
 * hints is sometimes more work than solving the puzzle - a better, and
 * more human friendly, mechanism is needed.
 *
[...2431 lines suppressed...]
        /* Check for a solution */
        if( 0 == completed )
        {
            for( i = 0 ; i < 81 && !IS_EMPTY( i ) ; ++i )
                ;
            if( 81 == i && 0 == fix( ) )
            {
                beep( );
                set_status( "Well done - you've completed the puzzle!" );
                completed = 1;
            }
        }
    }

    move( 23, 0 );
    endwin( );

    return 0;
}


--- NEW FILE: Makefile ---
#!/usr/bin/make
#
# This makefile and all associated files has been placed into
# the public domain by Michael Kennett (July 2005), and can be
# used freely by anybody for any purpose.

OWN=-o bin
GRP=-g operator

# Minix requires compilation flags for a clean compile
sudoku: sudoku.c
	if [ -x /usr/bin/uname -a `/usr/bin/uname` = Minix ] ; then \
	DEFS="-D_MINIX -D_POSIX_SOURCE" ; fi ; \
	$(CC) -o sudoku $$DEFS sudoku.c -lcurses

clean:
	rm -f sudoku

# Simple support for alternate systems
install: sudoku sudoku.6
	if [ -x /usr/bin/uname -a `/usr/bin/uname` = Minix ] ; then \
	install -s -S 8kw $(OWN) $(GRP) -m 755 sudoku /usr/bin/sudoku ; \
	else \
	install -s $(OWN) $(GRP) -m 755 sudoku /usr/bin/sudoku ; \
	fi
	install -d $(OWN) $(GRP) -m 755 /usr/lib/sudoku
	install $(OWN) $(GRP) -m 644 template /usr/lib/sudoku/template
	if [ -d /usr/man/man6 ] ; then \
	install $(OWN) $(GRP) -m 644 sudoku.6 /usr/man/man6/sudoku.6 ; \
	elif [ -d /usr/share/man/man6 ] ; then \
	install $(OWN) $(GRP) -m 644 sudoku.6 /usr/share/man/man6/sudoku.6 ; \
	else \
	echo Warning: Manual page not installed ; \
	fi


--- NEW FILE: sudoku.6 ---
.\" Written by Michael Kennett, July 2005. This work, and all
.\" associated files, has been placed into the public domain
.\" and may be used freely by anybody for any purpose.
.TH SUDOKU 6
.SH NAME
sudoku \- sudoku board game
.SH SYNOPSIS
(play the game)
.RS
.B sudoku
.RI [ options "] ... "
.RI [ <filename> ]
.RE
.PP
(generate boards)
.RS
.B sudoku -g
.RI [ <num> ]
.RI [ options "] ..."
.RE
.PP
(solve boards)
.RS
.B sudoku -v
.RI [ options "] ..."
.RE
.PP
(calculate statistics)
.RS
.B sudoku -s
.RI [ options "] ..."
.RE
.SH DESCRIPTION
The
.B sudoku
board game is played on a 9x9 grid, divided into rows, columns, and
9 blocks of 3x3 squares. The objective is to fill the empty squares
with the digits 1-9, so that each row, column, and block contains
each of the digits 1-9 (and hence, it is not possible for any digit to
appear twice in the same row, column or block).
.SH EXAMPLE
Consider the following board, and the squares marked `\fIa\fR'-`\fIh\fR'
and `\fIx\fR':

  5 . \fIa\fR | 6 \fIb\fR 1 | . . .       The digits appearing in each of the
  7 9 . | . . . | \fIc\fR 6 8       squares `\fIa\fR'-`\fIh\fR' can be uniquely
  \fId\fR 3 . | . 8 . | 7 . .       determined. For example, the value
 -------+-------+-------      at `\fIa\fR' must be 8, since an 8 appears
  . 5 . | 4 1 \fIe\fR | . . 2       in the other rows and columns of the
  . . 1 | \fIf\fR \fIx\fR . | 6 . .       block. Using similar logic, it must
  8 . . | . 3 7 | . 4 .       be true that:
 -------+-------+-------           \fIb\fR = 7        \fIf\fR = 8
  . . 4 | . 9 . | \fIg\fR 2 .            \fIc\fR = 1        \fIg\fR = 8
  2 8 \fIh\fR | . . . | . 9 7            \fId\fR = 1        \fIh\fR = 5
  . . . | 5 \fIi\fR 8 | . . 6            \fIe\fR = 6        \fIi\fR = 2

In contrast, it is not possible to uniquely determine the value of `\fIx\fR'
with the given information - it could take either the value 2 or 5.
.bp
The board now contains the squares:

  5 . 8 | 6 7 1 | . . .    It is now possible to determine the values
  7 9 . | . . . | 1 6 8    appearing in other empty squares.
  1 3 . | . 8 . | 7 . .
 -------+-------+-------
  . 5 . | 4 1 6 | . . 2
  . . 1 | 8 \fIx\fR . | 6 . .    <<< the value of \fIx\fR must now be 5.
  8 . . | . 3 7 | . 4 .
 -------+-------+-------
  . . 4 | . 9 . | 8 2 .
  2 8 5 | . . . | . 9 7
  . . . | 5 2 8 | . . 6

Repeating this process a few more times reveals the solution:

  5 4 8 | 6 7 1 | 2 3 9
  7 9 2 | 3 4 5 | 1 6 8
  1 3 6 | 9 8 2 | 7 5 4
 -------+-------+-------
  3 5 7 | 4 1 6 | 9 8 2
  4 2 1 | 8 5 9 | 6 7 3
  8 6 9 | 2 3 7 | 5 4 1
 -------+-------+-------
  6 1 4 | 7 9 3 | 8 2 5
  2 8 5 | 1 6 4 | 3 9 7
  9 7 3 | 5 2 8 | 4 1 6
.SH "GAME INTERFACE"
The
.B sudoku
game has a simple text interface (using the
.BR curses (3)
library). The board is displayed in the middle of the screen, along with
a summary of the allowed key presses. The cursor can be moved around the
board using the arrow keys or the standard
.BR vi (1)
movement keys, and each square (except for the fixed board squares that
are initially revealed) can be set to a given digit by pressing the
corresponding number key, or cleared by pressing either the `\fI0\fR' or
`\fI.\fR'
keys.
.SS "Generating a New Board"
A new board can be generated at any time by pressing the `\fIn\fR' key, and
either a \fIprecanned\fR or randomly generated board will be displayed.
If the \fB-n\fR command line option is set, then only \fIprecanned\fR boards
will be displayed.
.SS "Entering a Custom Board"
A custom board (e.g. found on the internet, or published in a newspaper)
can be entered into the game by first clearing the current board (press
the `\fIc\fR' key), entering the published squares (using the cursor
motion keys and entering the appropriate numbers), and then fixing the
squares by pressing the `\fIf\fR' key. At this point, the entered squares
will be fixed (and cannot be changed).
.SS "Hints"
The interactive game provides a simple hint mechanism to provide
assistance in solving the board. It attempts to highlight areas of the
board where moves can be made. If repeated hints are requested, the
system starts revealing the digit that can be placed on the board.

Often the hints can be quite cryptic. For example, consider the board
below:

    v v v

    . . 7 | . . \fB9\fR | . . .
    \fB9\fR . \fB6\fR | 7 \fB4\fR . | . \fB1\fR \fB5\fR
    . . \fB2\fR | \fB5\fR \fB1\fR . | . . .
   -------+-------+-------
 >  \fB6\fR . \fB5\fR | . 7 . | . . \fB8\fR  <    \fIThe characters ><v^ highlight the\fR
 >  . \fB7\fR . | . . . | . \fB3\fR .  <    \fIarea of the hint\fR
 >  \fB8\fR . . | . . . | \fB7\fR . \fB6\fR  <
   -------+-------+-------
    . . . | . \fB6\fR \fB7\fR | \fB8\fR . .
    \fB7\fR \fB4\fR . | . \fB5\fR . | \fB9\fR 6 \fB2\fR
    . 6 . | \fB4\fR . . | . . .

    ^ ^ ^

The system gives the hint `\fItry the digit 3\fR', but it is certainly not
obvious, with the revealed squares, where the 3 goes.

.SH OPTIONS
.TP
.BI -d
Describe the moves needed to solve the board. Can only be used with the
.B -v
option for solving
.I precanned
boards.
.TP
.BI -f <format>
Set output format. The supported formats are:
.ta 0.25i 1.25i
.nf
	\fBstandard\fR	Default text format; \fBstd\fR is a shortcut.
	\fBcompact\fR	Compact text format.
	\fBcsv\fR	Comma separated values, suitable for importing
			into a spreadsheet.
	\fBpostscript\fR	\fBps\fR is a shortcut.
	\fBhtml\fR	Simple HTML.
.fi
.TP
.BI -g "[<num>]"
Generate
.I <num>
boards (or just 1 board, if not specified) and write them to standard output.
.TP
.BI -n
No random boards generated in the interactive game. Requires the optional
file of \fIprecanned\fR boards to be specified.
.TP
.BI -r
Run in restricted mode, disallowing any games to be saved.
.TP
.BI -s
Calculate statistics for the
.I precanned
boards, and attempt to classify
the difficulty of solving the boards. Can be used with the
.B -v
option.
.TP
.BI -t "<filename>"
Set the template file. The file set on the command line will be used 
instead of the default template file.
.TP
.BI -v
Solve
.I precanned
boards, writing the solution to standard output.
.TP
.I <filename>
Name of the optional file containing
.I precanned
boards.
.SH ENVIRONMENT
No environment variables are used directly by the
.B sudoku
program.
.SH FILES
.TP
.BI /usr/lib/sudoku/template
Template file for generating new sudoku boards.
.TP
.BI /usr/lib/sudoku/precanned
Optional file, containing `precanned' sudoku boards.
.SH "FILE FORMATS"
.SS /usr/lib/sudoku/template
The template file contains a sequence of patterns that are used for
generating new
.B sudoku
boards. Each pattern is started by a line with a leading `%' character,
and consists of 9 lines of 9 characters. The character `.' represents a
square that is initially blank, and the character `*' represents a square
with a digit that is initially displayed.
.SS "Compact text format"
This format is similar to that of the template file, but contains
representations of game boards. Each board is started by a line with a
leading `%' character, followed by an optional title for the board that
is displayed when the game is played. This is followed by 9 lines of
9 characters, where the character `.' represents an initially empty square,
and the characters `1'-`9' give the value of a fixed board square that
is initially displayed. The
.B sudoku
program can read precanned files in this format, and will write them
when the
.B -fcompact
option is set.
.SS "Standard text format"
This format is very similar to the compact text format, but includes
additional characters to delimit the blocks in the board. The
.B sudoku
program can read precanned files in this format, and writes them by
default, unless another output format is set by the
.B -f
option.
.SS "Comma separated text format"
This format is useful for importing
.B sudoku
boards into a spreadsheet. It represents each board by 9 lines of
comma separated fields. Each field is blank, or contains a digit.
The
.B sudoku
program cannot read precanned files in this format, and writes them
when the
.B -fcsv
option is set. Unlike the standard or compact text formats, there
are no lines separating boards, and hence, it is really only feasible
to store one board per file.
.SS "Postscript format"
This format is useful for printing out
.B sudoku
boards. The
.B sudoku
program cannot read boards stored in this format, and writes them
when the
.B -fpostscript
option is set. Unlike the standard or compact text formats, it is
not possible to store multiple boards in the same file.
.SS "HTML format"
This format is useful for printing out
.B sudoku
boards. The
.B sudoku
program cannot read boards stored in this format, and writes them
when the
.B -fhtml
option is set. Unlike the standard or compact text formats, it is
not possible to store multiple boards in the same file.
.SH "SEE ALSO"
There are a large number of websites dedicated to the
.B sudoku
puzzle that can be found easily using a search engine.
Some of these sites provide game boards that can be challenging
to solve, and others provide strategies for finding moves.
.SH DIAGNOSTICS
There are limited diagnostics available when an error occurs.
.SH ACKNOWLEDGEMENTS
Mark Foreman for the HTML output format; Joanna Ferris and Heather for
encouraging this endeavour.
.SH AUTHOR
Michael Kennett (mike at laurasia.com.au)
.SH COPYRIGHT
This manual page, and all associated files, have been placed into
the public domain by Michael Kennett, July 2005. They may be used
by anybody for any purpose whatsoever, however \fBNO WARRANTY\fR, of any
sort, applies to this work.





----- End forwarded message -----

-- 
stefan
http://stsp.in-berlin.de                                 PGP Key: 0xF59D25F0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://mailman.dslinux.in-berlin.de/pipermail/dslinux-commit-dslinux.in-berlin.de/attachments/20061112/2f1ca0a7/attachment.pgp 


More information about the dslinux-commit mailing list