Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool estValide (int tab[9][9],int position){
- int i,j,nb;
- if(position==81){
- return true;
- }
- i=position/9;
- j=position%9;
- if(tab[i][j]!=0){
- return estValide(tab, position+1);
- }
- else{
- for(nb=1;nb<=9;nb++){
- if(absentSurLigne(nb,tab,i) && absentSurColonne(nb,tab,j) && absentSurBloc(nb,tab,i,j)){
- tab[i][j]=nb;
- if(estValide(tab,position+1)){
- return true;
- }
- }
- }
- }
- tab[i][j]=0;
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement