Guest User

Untitled

a guest
Apr 21st, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. Board* Board::search(void) {
  2. for (int x=0; x<9; x++)
  3. for (int y=0; y<9; y++){
  4. if(!fs[x][y].assigned()){
  5. for (int d=1; d<=9; d++){
  6. if(fs[x][y].in(d)){
  7. Board* copy = new Board(*this);
  8. bool test = (*copy).assign(x,y,d);
  9. if(test){
  10. return copy->search();
  11. }
  12. }
  13. }
  14. return NULL;
  15.  
  16. }
  17. else{
  18. return copy;
  19. }
  20. }
  21. }
Add Comment
Please, Sign In to add comment