Sudoku Solver v0.7
Brad adds triplet-set detection, adds an
icon, and fixes a bug that caused the number 9 to be ignored.
Last weekend I took some time while at the
cottage to fix a few things in the last release of my Sudoku
SolverFirst off, a small bug. A for
loop in one of the methods used to check the possible values was scanning for
values between 0 and 8, instead of 1 and 9. This meant that a portion of the
code was running meaningless tests for a solution of '0' (which isn't allowed or
possible), and never processed the number
9.While I was at it, I removed the
second scan loop in the method that tests a number group for cells which are the
only ones that could hold a possible value. I don't recall why I originally did
things that way, but considering all I needed was a single id pointer to store
the last discovered cell, scanning through once again was a waste of processor
cycles. And considering we looped through this 9 times for each cell of the
puzzle during each run through the solve loop, one could easily waste a few
hundredths of a second -- completely
needlessly.I also put together a
simple icon, and added the ability for the puzzle to detect triplet sets (i.e:
three cells which share the same three possible
values).Here is the latest build
archive:Sudoku Solver v0.7:
Sudoku_Solver_v0-7.zip...and
the latest sources:Sudoku Solver v0.7
Sources (GPL):
Sudoku_Solver_v0-7_src.zipBy
the way, in the event you hadn't noticed, I've enabled commenting and trackbacks
in my blog, so if you have any questions or comments, please feel free to leave
them either here, or at your own blog with a trackback.
Posted: Thursday - July 07, 2005 at 11:05 PM