So I've been porting my PHP Sudoku script to C# and just came across an issue。。。
It would never generate the full puzzle...
After about an hour of running in circles, I found the answer...
It's always the simplest things that get me stuck for the longest periods of time.Code:public int[] getBox(int x, int y) { x = 5;
Must remember to remove test variables.
The good news...
Now with a 0.3% generation success rate.Code:{1, 2, 3, 4, 5, 6, 7, 8, 9} {8, 7, 5, 9, 2, 3, 1, 6, 4} {6, 9, 4, 7, 8, 1, 5, 3, 2} {4, 5, 9, 1, 6, 7, 8, 2, 3} {3, 8, 2, 5, 9, 4, 6, 7, 1} {7, 6, 1, 2, 3, 8, 4, 9, 5} {2, 1, 7, 8, 4, 9, 3, 5, 6} {5, 4, 6, 3, 7, 2, 9, 1, 8} {9, 3, 8, 6, 1, 5, 2, 4, 7}
Last edited by Celestial; 01-23-2013 at 04:05 AM.
If my post helped please send $2,000,000 via PayPal!