src/main/java/de/uapcore/sudoku/Solver.java

changeset 12
1c62c6009161
parent 10
369903afbb29
--- a/src/main/java/de/uapcore/sudoku/Solver.java	Sat Jul 25 15:56:48 2020 +0200
+++ b/src/main/java/de/uapcore/sudoku/Solver.java	Mon Jul 27 10:56:17 2020 +0200
@@ -148,7 +148,7 @@
     public boolean solve(Field f) {
         
         // Calculate initial candidates
-        List<Integer> candidates[][] = new List[9][9];
+        List<Integer>[][] candidates = new List[9][9];
         for (int x = 0 ; x < 9 ; x++) {
             for (int y = 0 ; y < 9 ; y++) {
                 candidates[x][y] = new ArrayList<>(9);
@@ -189,7 +189,7 @@
      * @return true, if the check succeeds, false otherwise
      */
     public boolean check(Field f) {
-        int line[];
+        int[] line;
         for (int i = 0 ; i < 9 ; i++) {
             line = f.getRow(i);
             if (!valid(line)) {
@@ -201,7 +201,7 @@
             }
         }
         
-        int square[][];
+        int[][] square;
         for (int x = 0 ; x < 3 ; x++) {
             for (int y = 0 ; y < 3 ; y++) {
                 square = f.getSquare(x, y);
@@ -215,7 +215,7 @@
     }
     
     private boolean valid(int[] line) {
-        int numbers[];
+        int[] numbers;
         numbers = new int[9];
         for (int i = 0 ; i < 9 ; i++) {
             int l = line[i]-1;

mercurial