Click here to Skip to main content
15,892,517 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello....tell me how to generate & solve a sudoku in c++
Posted
Comments
SnowHow 27-Sep-10 8:38am    
This is a very common programming test for game companies and research firms... There are more than likely plenty of answers on the internet however in the interest of actual learning write some code and if you have some issues come back with specific questions.

You can solve sudoku problem by backtracking.
like ->

1 0 2
0 3 9
4 0 0

now write a backtracking method which fill the o position values by some acceptable value that can be set in that row & column. By this backtrack, if you can reach the last row & last column then you have get a solution :-D

If you need code, you can mail me.
 
Share this answer
 
Comments
yuxb 27-Sep-10 8:12am    
I want to learn about what is backtracking,appreciate for a copy of code.My mail is FightingYuman@163.com
Have a look at the links suggeasted here[^].
Try now.

Here is what is expected by enquirers:
1. TRY first what you want to do!
2. Formulate what was done by you that looks like an issue/not working.

Try them and tell if you face issues.
Members will be more than happy to help like this.
 
Share this answer
 
Hi,

the following article explains what you try to achieve:

http://www.codeproject.com/KB/miscctrl/XSudokuWnd.asp[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900