Advertisement
Guest User

Untitled

a guest
Apr 26th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.48 KB | None | 0 0
  1. bool SudokuSolver(int tab[9][9],int position){
  2.     int s=0,p=0,i,j,nb;
  3.  
  4.     if(position==81){
  5.         return true;
  6.     }
  7.     else if(CaseVide(tab,&i,&j)==true){
  8.         for(nb=1;nb<10;nb++){
  9.             if(!EstPresentC(tab,s,nb) && !EstPresentL(tab,s,nb) && !EstPresentR(tab,s,p,nb)){
  10.                 tab[i][j]=nb;
  11.                 if(SudokuSolver(tab,position+1)==true){
  12.                 return true;
  13.                 }
  14.             }
  15.         }
  16.         return false;
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement