Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(m[row][col]==0){
- for(int num = 1; num<10; num++){
- if(tryAddNbr(row,col,num)){
- setValue(row, col, num);
- if(col<8){
- if(solve(row, col+1)){
- return true;
- }
- }else if( col == 8){
- if(solve(row+1, 0)){
- return true;
- }
- }
- }
- setValue(row, col, 0);
- }
- return false;
- }
- if(col<8){
- return (solve(row,col+1));
- }else{
- return (solve(row+1, 0));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement