Home >Java >javaTutorial >Detailed examples of Sudoku algorithm
class SudokuMatrix { private int[][] matrix = new int[][] { {0, 5, 0, 6, 0, 1, 0, 0, 0}, {0, 0, 7, 0, 9, 0, 0, 2, 0}, {3, 0, 0, 0, 0, 4, 0, 0, 1}, {9, 0, 0, 0, 0, 0, 1, 3, 0}, {0, 0, 8, 0, 5, 0, 7, 0, 0}, {0, 2, 6, 0, 0, 0, 0, 0, 8}, {7, 0, 0, 9, 0, 0, 0, 0, 5}, {0, 9, 0, 0, 4, 0, 3, 0, 0}, {0, 0, 0, 2, 0, 8, 0, 1, 0}, }; public void run(){ calc(); } private void calc() { int[] coordinate = getNextData(); int m = coordinate[0]; int n = coordinate[1]; for (int k = 1; k
The above is the detailed content of Detailed examples of Sudoku algorithm. For more information, please follow other related articles on the PHP Chinese website!