Check out: http://www.freewebs.com/dcrooks/projects.html. Its a sudoku
solving program I created that uses Donald Knuth's dancing links algo.
You can read my code while trying to understand Donald Knuth's paper.
His paper can be found at:
http://xxx.lanl.gov/PS_cache/cs/pdf/0011/0011047.pdf
I'm just now coding a Sudoku solver, in BASIC. This is the info I used
(after much work because I'd never messed with Sudoku before), to code
my program.
It's not nearly as small as the one posted above, but it uses a virtual
odometer at the end for any trial and error that's needed - so I
enjoy
Search this groups mail. This question has been answered previously.
The fastest implementation uses bit vectors.
On 6/29/06, Roberto Abreu [EMAIL PROTECTED] wrote:
Here's my solution.
public static boolean isValid(int i, int j, int v) { for (int k = 0; k LENGTH; k++) if ( (table[ i ][ k ]
Here's my solution.
public static boolean isValid(int i, int j, int v) { for (int k = 0; k LENGTH; k++) if ( (table[ i ][ k ] == v) || (table[ k ] [ j ] == v) ) return false;
i = i % COUNT_SUBTABLES == 0 ? i : (i - 1) % COUNT_SUBTABLES == 0 ? i - 1 : i - 2;
j = j % COUNT_SUBTABLES == 0 ? j :