Explicit null, slight restructure

This commit is contained in:
Imbus 2023-12-05 15:55:40 +01:00
parent 6b60cac90a
commit 24463fe920

View file

@ -1,7 +1,7 @@
package sudoku; package sudoku;
public class Solver implements SudokuSolver { public class Solver implements SudokuSolver {
private int[][] board; private int[][] board = null;
public Solver() { public Solver() {
board = new int[9][9]; board = new int[9][9];
@ -15,10 +15,6 @@ public class Solver implements SudokuSolver {
return board; return board;
} }
public boolean solve() {
return solve(0, 0);
}
/** /**
* Resets the board to all zeros * Resets the board to all zeros
*/ */
@ -26,6 +22,10 @@ public class Solver implements SudokuSolver {
board = new int[9][9]; board = new int[9][9];
} }
public boolean solve() {
return solve(0, 0);
}
/** /**
* Recursive helper method for solve() * Recursive helper method for solve()
* *