Overview
- The goal of this project is to create the program that can solve most of the sudoku faster than an average human using C/C++ programming language
Planing
Pseudo Code
- Start Program
- Get initial 9*9 sudoku map from user
- Count the number of blanks and save it to a variable blankCnt
- Create an 3 demational array with size of 9X9X9 and initiallize it with 0
- Check 3*3 box, horizontal and vertical line for one missing blank
- If a blank has been filled out, decrease blankCnt by one
- Add numbers that are possible to fit in a blank to 3D array we have created
- Erase the numbers in the candidate array according to sudoku rules(Duplicates in 3X3 box, horizontal line, and vertical line)
- If there is only one candidate in the 3D array for a blank, write that number into the original array
- If a blank has been filled out, decrease blankCnt by one
- If blankCnt is equal to zero, finish the program
- If blankCnt is a negative integer, print error to the screen and finish the program
- If blankCnt is a positive integer, goto step 7
- If the program has finished without any errors, print the filled sudoku and how long did it take
Programming
Day 1
June 20th, 2020
1 |
|
Day 2
June 21st, 2020
There are some errors in checkSudoku fucntion(method)
1 |
|
Day 3
June 29, 2020
1 |
|
Day 4
July 1, 2020
1 |
|
The program can solve teh sudokus with one candidate on one blank. It has been checked running on VS community 2015
Day 5
1 |
|
The swap function is newly added to the program using pointer.
Logs
Current Errors
Error when inputting blank on the last digit of each row
When the sudoku has the last digit of each row blank, it does not detect it has a valid char.
Resolved Errors
Known Error in CandidateMappingAdd() function
Unable to identify on GroomIDE. Need farther inspection on IDEs (Xcode, VS)
Day 3
Known Error in CandidateMappingAdd() function
Unable to identify on GroomIDE. Need farther inspection on IDEs (Xcode, VS)
Day 4
Error when inputting blank on the last digit of each row
When the sudoku has the last digit of each row blank, it does not detect it has a valid char.
Conclusion
First part of the project has been finished. Although there are some know bugs, the program can solve and check if they are correctly solved on its own. The next part of the project will be resolving the bugs that are found and making the software more advanced so that it can solve more complex sudokus.