![]() |
Creating a list of values
I am just getting back into programming and would like to create a program
to solve Su Doku puzzles as a refresher. I have created a table on top for the user to input the values and another below that for the solution. In the solution table, I will have it check to see if there is a value in the corresponding cell in the input table via an IF THEN ELSE formula. If there is a value, it will simply be copied down. If there isn't, I would like to check to see which numbers (1-9) are in that row, in that column, and within the 3x3 block (1-3, 1-3) and eliminate those as possible values for that cel, but can I create a LIST of values? For example, lets say that 1, 4, 5, 7, and 9 are already present in the row, column, or block. That means that cell 1,1 cannot be those values, but it could be 2, 3, 6, or 8. I would then continue populating each cel with possible choices until I got to cel 9,9. Any suggestions would be greatly appreciated! Thanks in advance. -- Jeff C |
Creating a list of values
Hi Jeff,
I built my solver using FIND--REPLACE code and named ranges. I put the given numbers (clues) on the board and then I have a routine "Enter Numbers" that puts 1 thru 9 in each open square in the puzzle. Then I use my "Sift Numbers" button by selecting a given number (clue) and click the sift button. The routine finds any of that number in the 3 x 3 box and the horizontal line and the vertical column and eliminates them all. Select the next given number and do the same etc... in all nine 3 x 3's. Or I can use my "Auto Sift" routine and it runs from upper left to bottom right doing the same thing. Some times on a fairly easy puzzle it will just solve the whole puzzle if run a couple--three time. Takes the fun out of the puzzle solving but I was honing program skill not Sudoku skills. On the Evil level puzzles it will not do the upper level logical deductions that are needed and I have to press gray matter into play. I can send you a copy if you wish. Of course it's armature level code, NOT Chip P, Tom O, John W stuff but I did get a nice piece of advice from Norman Jones on straightening out some troublesome code. Regards, Howard "JC Home" wrote in message ... I am just getting back into programming and would like to create a program to solve Su Doku puzzles as a refresher. I have created a table on top for the user to input the values and another below that for the solution. In the solution table, I will have it check to see if there is a value in the corresponding cell in the input table via an IF THEN ELSE formula. If there is a value, it will simply be copied down. If there isn't, I would like to check to see which numbers (1-9) are in that row, in that column, and within the 3x3 block (1-3, 1-3) and eliminate those as possible values for that cel, but can I create a LIST of values? For example, lets say that 1, 4, 5, 7, and 9 are already present in the row, column, or block. That means that cell 1,1 cannot be those values, but it could be 2, 3, 6, or 8. I would then continue populating each cel with possible choices until I got to cel 9,9. Any suggestions would be greatly appreciated! Thanks in advance. -- Jeff C |
All times are GMT +1. The time now is 01:02 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com