fSudoku

Version 0.5
Description fsudoku solves and generates sudokus. Classical sudokus are 9*9 arrays of numbers. Each row, each column and each of the nine 3*3 sub-arrays must contain all number 1..9. fsudoku supports sudokus of the sizes 4*4, 9*9, 16*16, 25*25 which are said to be of orders 2, 3, 4, 5 respectively.
Environments Win32 / OS/2 / Linux command line
Compiler Windows: MS Visual C++ 6.0
OS/2: Open Watcom C++ 1.3
Linux: gcc 3.3.3
Porting Easy.
How to use ? fsudoku generates solutions of given problems or generates one-solution-problems from a given problem which has more than one solution.
Each sudoku size has it's own executable, symbol set, sample problem files:
order size symbol set OS/2 executable Windows executable Linux executable sample files
2 4*4 1234 fsudoku2 fsudokuw2 fsudokux2 two*.txt
3 9*9 123456789 fsudoku3 fsudokuw3 fsudokux3 three*.txt
4 16*16 0..9A..F fsudoku4 fsudokuw4 fsudokux4 four*.txt
5 25*25 abc..wxy fsudoku5 fsudokuw5 fsudokux5 five*.txt
How does it work ? The state of a sudoku is kept in an array of size elements (e.g. 81 short ints for order 3). Each element contains either the already found or set symbol (as a negative number) or the set of possible symbols (as bit-encoded value).
A recursive back-tracking algorithm searches for all solutions.
Problem generation starts at not fully solved problems that have only  one solution, these are found during the search for solutions.
A stupid trial-and-error algorithm tries to eliminate as much symbols from this problem as possible.
How to build ? call mk
How to install ? no installation needed, just copy the files
Author Frank Reglin at suggestion by Klaus Taeschner
License General Public License
Binaries fsudoku_bin_os2_0_5.zip
fsudoku_bin_win_0_5.zip
fsudoku_bin_linux386_0_5.zip
Sources fsudoku_src_0_5.zip
Documentation Calling one of the executables without arguments prints a short one. Try to solve the sudokus in the sample directory. Try to generate from three20.txt or three0.txt.
Older versions -
Ideas for further development
  • Write a better generation algorithm (or at least a more intelligent version of the extract() function). For orders 4 and 5 the implemented algorithm is simply too slow.
  • Klaus' son used Knuth's DLX algorithm for solving sudokus - very fast ! Try this, it might be useful for the generator as well.
  • GUI, e.g. by using wxWidgets