GITHUB Project Address:
https://github.com/hhz-hhz/Sudoku_software_engineer.git
Zero, the task
Be able to achieve a final and can generate Sudoku Sudoku solver console application problem.
First, the needs analysis
1, the general requirements
2, generate final
(1), using the command line
(2), with the final use a text file, the next time the cover txt file txt file
Similar to the following format:
(3), capable of handling various abnormalities
(4) generates a number of requirements unique matrix
Format is as follows:
3, solving Sudoku
(1), results in the form of solving
(2), sudoku puzzle format
(3), sudoku.txt format: the same final format generation.
(4), the number of unique subject number N (1 <= N <= 1000 000), to ensure that only the number of the correct format file
4, number of Sudoku generator make a GUI interface, along with a brief description (additional)
Second, the design phase
1, the estimated development time table --PSP 2.1
2, problem-solving ideas
I decided to use C ++ to complete this project.
Sudoku project can be divided into several parts:
Generate final:
After a review of relevant information, in the following ways: violence backtracking, matrix conversion method, the ranks of exchange, randomization methods.
An efficient algorithm to generate Sudoku
Generated value matrix conversion method Zhongpan
Intention to try to use the full array to generate and transform the ranks.
Solving Sudoku:
After the reference to online information, we decided to try using a depth-first algorithm dfs
unit test:
Because not familiar with unit testing, so access to a lot of information, the following websites speak more clearly: