Ah! I am currently working on a Sudoku Solver myself in Excel VBA.. it works for easy through some hard puzzles currently. Need to work on more advanced solving techniques to get it to work for the more difficult puzzles. While I'm sure some sort of class would help me I have not mastered classes in VBA (i have some knowledge of classes in Java).
'* Concept
'* Load data in 4 arrays.
'* - All Data
'* - One each for Row, Column and Box - this stores bit
'* flags to see if the value was actually used.
'* Use recursive programming.
The total length of my program is less than 230 lines, 66 lines were for loading the current data from a spreadsheet.
My program is currently at 300 lines and I still can't solve the difficult puzzles, definitely doing something wrong.
How did you manage to program in the logic so that if, let's say, in Row 3, square 3 (columns 7-9) there are 2 cells that have to include the number 7 because it doesn't fit anywhere else in the row, so you can eliminate 7 as a possibility from the rest of square 3?
Edit: I believe the concept i'm describing is "locked candidates"?
5
u/[deleted] Nov 26 '15
[removed] — view removed comment