Sodoku - Create & Play

Screenshot

Here you'll find a Sodoku program for Linux and Windows. It's bound to run on other platforms too, but I haven't tested that. It's written in Python using wxPython, so chances are you can run it on an untested system without a single modification to the source.

Features

  • Nice, simple GUI,
  • Displays puzzles of any size,
  • Can load and save puzzles in an easy to understand plain-text format,
  • Can help you solve a puzzle by giving hints,
  • Can generate new puzzles up to 12x12. Larger sizes are possible, but a lot of patience is needed,
  • 400 puzzles are already pre-generated,
  • A directory of puzzles can be opened at once. If puzzles from the puzzle pack are played in this way, the game will offer the easiest one first, and make things more and more difficult along the way,
  • All generated puzzles are guaranteed to have a unique solution,
  • Cross platform,
  • Can solve puzzles quickly,
  • Can grade puzzles from 'easy' to 'near impossible',
  • Easy to install and build,
  • Clean and well-documented code,
  • Automatic check for new versions.

About the game

Sudoku (Japanese: 数独), sometimes spelled Sodoku, is a placement puzzle, also known as Number Place in some countries. The aim of the puzzle is to enter a numeral from 1 through 9 in each cell of a grid, most frequently a 9×9 grid made up of 3×3 subgrids (called "regions"), starting with various numerals given in some cells (the "givens"). Each row, column and region must contain only one instance of each numeral. (Source: Wikipedia)

This program was written as a contribution to the LinuxFormat Sodoku puzzle contest. Most people call it 'Sudoku', but LinuxFormat calls it 'Sodoku'. It's their contest, so I use their name.

Puzzle Pack

Because generating puzzles could take some time, I've created a puzzle pack with 400 puzzles. Just unzip it into a directory of your choice and play!

Installing

The only requirements of Unrealtower Sodoku are Python and wxPython. You might also need the python-dev package if you're on a system that has it. Most Linux distributions already include those. If you're on a system that hasn't got them already, they should be easy enough to install. Installation instructions of the requirements are beyond the scope of this document - see their own websites.

I suggest you read the section below that is specific for your system.

From source - all systems

Once the requirements have been taken care of and the tarball is downloaded, installation of Unrealtower Sodoku is very easy. Just give the following commands in the directory where you stored the game tarball:

tar zxvf unrealtowersodoku-1.7.tar.gz cd unrealtowersodoku-1.7 sudo python setup.py install

If you don't have sudo, make sure via other means that the python setup.py install command is executed as root (or equivalent system administrator user)

If you get an error about "/usr/lib/python2.x/config/Makefile" not existing on your system, you might need to install the 'python-dev' package.

Just give the sodoku command and you're off.

Ubuntu & Debian

Download the Debian package and install it using

dpkg -i unrealtowersodoku-1.7_all.deb

Alternatively, you can do the following as root:

echo 'deb http://stuvel.eu/files/sodoku/ ./' >> /etc/apt/sources.list apt-get update apt-get install unrealtowersodoku

Once that's done, you'll be able to automatically update Unrealtower Sodoku along with all your other software.

Make sure you have Python 2.4. If you have another Python version, install from source instead.

RedHat, Fedora and other RPM based systems

Download the RPM package and install it using

rpm -U unrealtowersodoku-1.7-0.noarch.rpm

Make sure you have Python 2.4. If you have another Python version, install from source instead.

I haven't got an RPM based system, so this one is untested. If it works for you, please let me know.

Windows

Download the ZIP file. It contains all you need - no need to download Python nor wxPython. Extract it to a directory of choice, and double-click 'sodoku.exe'.

Creating puzzles

When creating a puzzle larger than 9x9, be patient. It takes a tremendous amount of calculations to create a puzzle. Those calculations are done in a separate thread, so the program will react to you. No worries, it'll notify you when it is done calculating.

If it takes too long, just tell Unrealtower Sodoku you want to create a new puzzle again. It will tell you that it's already calculating a new puzzle, and ask you if you want to abort it.

Improvements

The first improvement I'll perform is the internal storage of the puzzle. At this moment, it uses strings. I'll change it to integers and use bitmasks to manipulate them. That should be much faster than string manipulation.

A new feature that I'll definitely add is the ability to print puzzles.

Currently, only square regions are supported. As a result, those are only implemented for square sizes (4, 9, 16 etc).

If anything in this documentation is unclear, please let me know. Patches for the program, suggestions, bugreports and beer are also very welcome.