[algogeeks] Suduko Solving Algorithm

2006-06-28 Thread [EMAIL PROTECTED]
Any one have any ideas for a very efficient suduko puzzle solver? I am currently using one I just thought of, but it is kind of slow. Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Algorithm Geeks group.

[algogeeks] Re: Suduko Solving Algorithm

2006-06-28 Thread Roberto Abreu
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 :