apps/sudoku-solver/controllers/sudoku-solver.js
// Check an existing complete solution to see if it's correct/complete
Check an existing complete solution to see if it's correct/complete
Check an existing complete solution to see if it ' s correct / complete
solutionCheck() {
    for (let row = 0; row < HEIGHT; row++) {
      for (let col = 0; col < WIDTH; col++) {
        let num = this._puzzle[row][col];
        this._puzzle[row][col] = 0;
        if(num === 0 || !this.isSafe(this._puzzle,row, col, num)) {
          this._puzzle[row][col] = num;
          return false;
        }
        this._puzzle[row][col] = num;
      }
    }
    return true;
  }
solutionCheck ( ) { for ( let row = 0 ; row < HEIGHT ; row ++ ) { for ( let col = 0 ; col < WIDTH ; col ++ ) { let num = this . _puzzle [ row ] [ col ] ; this . _puzzle [ row ] [ col ] = 0 ; if ( num === 0 || ! this . isSafe ( this . _puzzle , row , col , num ) ) { this . _puzzle [ row ] [ col ] = num ; return false ; } this . _puzzle [ row ] [ col ] = num ; } } return true ; }
Check an existing complete solution to see if it's correct/complete
Check an existing complete solution to see if it ' s correct / complete