sudoku: create high quality Sudoku puzzles


sudoku is a command line program for creating high-quality Sudoku puzzles. I wrote this in 2005-2006 when Sudoku was the craze of the day.

Online Demo

Generate a random Sudoku.

Sample Output

The following example was generated with:

sudoku -f html -p 000000000/011111110/011111110/011000110/011000110/011000110/011111110/011111110/000000000

Sudoku. Level 2


January 26, 2013: Release 0.2. Added a command line option --solve to solve a given puzzle.

January 13, 2006: Release 0.1. First public release.

Downloading and Installing

The current version of sudoku can be downloaded as a gzipped tar archive here: Unpack the archive by typing

        tar -zxf sudoku-0.2.tar.gz
This will create a directory sudoku-0.2 inside your current working directory. Change to this directory, and follow the instructions in the file INSTALL.


For more detailed usage information, see the man page.

 Usage: sudoku [options] [file...]
  -h, --help                 - print this help message and exit
  -v, --version              - print version info and exit
  -l, --license              - print license info and exit
  -n, --number n             - generate Sudoku number n (default: random)
  -f, --format fmt           - output format, default is text
  -a, --answer               - print answer. -aa to print answer only.
  -s, --symmetry sym         - set symmetry, default is random
  -L, --level [min]-[max]    - request difficulty level
  -p, --pattern pattern      - set pattern
  -S, --solve board        - solve the given puzzle
  -e, --exact                - request to match pattern exactly
 Available symmetries: none, vertical, horizontal, diagonal, codiagonal, dc, 
 vh, 180, 90, all, random (default). 
 Available output formats: text (default), bigtext, html. 
 Patterns are specified as in 000111000/001101100/.../000000000
 Boards are specified as in 000123000/004506700/.../000000000.




Copyright © 2005-2013 Peter Selinger.


This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.

See the file COPYING for details.

Back to Homepage: [home]

Peter Selinger / Department of Mathematics and Statistics / Dalhousie University
selinger@mathstat.dal.ca / PGP key
Updated January 26, 2013