Sign in to follow this  
Followers 0
danny0

Sudoku Logic

1 post in this topic

I think I have the plan for my sudoku solver laid out. I have finished a function to place known numbers and make sure there is not two of the same number in each row, column, or cell. I have also made a function(I think I am searching for singletons) to find the value of a box in any row, column or cell if every other value in that row, column, or cell is filled. Here is my plan for the rest of the solver.

Apply Given Numbers

1. Apply known values to the grid

2. For each known number, erase that possibility from that row, column, and cell

3. See if there is only one possibility in a box

4. If one possibility, then place value into the box

Look for Singletons

1. For each row column, or cell, count the frequency of each number

2. If the frequency of the number is one, then the value of that box is the number.

3. Repeat Phase 1 when a number is found.

4. Repeat this phase until no more numbers can be found

Pairs

1. See if a pair of numbers can be found in only two boxes in a row, column, or cell.

2. If the above is true, all other values except the pair can be eliminated from all other boxes in that row, column, or cell

3. Repeat Phase two which will then loop it to Phase 1

This plan was made thanks to a website suggested by system24. Comments are welcome.

Sudoku_Solver.au3

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0