All your Sudoku puzzles are belong to us

2007 January 23
by Ilya

Today I have found Sudokuza while revising my archives. This program solves Sudoku puzzles. I sketched it more than a year ago for fun to avoid Sudoku mania :) My main goal was to create a program that would solve a puzzle the similar way as a human would do, without a hardcore math.

The algorithm is very simple and straightforward. Sudokuza eliminates a solved number from the variants for remaining cells within the corresponding row, column, and 3×3 block. All cells with a single variant left assumed as solved. If Sudokuza cannot eliminate anything then it takes one of the remaining variants from the first unsolved cell as a correct answer and tries to continue. And so on, until puzzle is solved or given up. Sudokuza gives up on a cell with zero variants left or an impossibly solved number.

Sudokuza is written in C and here is its source code – sudokuza.c. There is also a ZIP archive (34kb) with source code, compiled executable and few sample puzzles.

Since I wrote Sudokuza primarily for personal entertainment, it is not that user-friendly. It is a command-line utility, which inputs a puzzle from a specified text file:

sudokuza.exe yourpuzzle.txt

The file format is simple – first nine characters from the first nine lines forms a Sudoku grid. Look inside the ZIP archive for samples, these are easy to understand.

Have fun :)

Reddit this / Add to del.icio.us / Digg this!
5 Comments leave one →
2007 January 28

I did that too here (but with javascript and html) because some of the puzzles just annoyed me. Looks like the same method, only I used a bitmask rather than a struct.

Keep up with the good work on the site!

2007 January 28

Your link is malfunctioning.

2007 March 24

when i tried to unzip the file it asked me for a password……please help..

2007 March 25

Roxy,

There is no password in sudokuza.zip. It is probably because of your unzip program. Try an empty password then.

2008 August 11
jung-gak Kwon permalink

I can’t wait to solve sudoku puzzles.

Leave A Comment

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS