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

changeset 12
1c62c6009161
parent 10
369903afbb29
     1.1 --- a/src/main/java/de/uapcore/sudoku/Solver.java	Sat Jul 25 15:56:48 2020 +0200
     1.2 +++ b/src/main/java/de/uapcore/sudoku/Solver.java	Mon Jul 27 10:56:17 2020 +0200
     1.3 @@ -148,7 +148,7 @@
     1.4      public boolean solve(Field f) {
     1.5          
     1.6          // Calculate initial candidates
     1.7 -        List<Integer> candidates[][] = new List[9][9];
     1.8 +        List<Integer>[][] candidates = new List[9][9];
     1.9          for (int x = 0 ; x < 9 ; x++) {
    1.10              for (int y = 0 ; y < 9 ; y++) {
    1.11                  candidates[x][y] = new ArrayList<>(9);
    1.12 @@ -189,7 +189,7 @@
    1.13       * @return true, if the check succeeds, false otherwise
    1.14       */
    1.15      public boolean check(Field f) {
    1.16 -        int line[];
    1.17 +        int[] line;
    1.18          for (int i = 0 ; i < 9 ; i++) {
    1.19              line = f.getRow(i);
    1.20              if (!valid(line)) {
    1.21 @@ -201,7 +201,7 @@
    1.22              }
    1.23          }
    1.24          
    1.25 -        int square[][];
    1.26 +        int[][] square;
    1.27          for (int x = 0 ; x < 3 ; x++) {
    1.28              for (int y = 0 ; y < 3 ; y++) {
    1.29                  square = f.getSquare(x, y);
    1.30 @@ -215,7 +215,7 @@
    1.31      }
    1.32      
    1.33      private boolean valid(int[] line) {
    1.34 -        int numbers[];
    1.35 +        int[] numbers;
    1.36          numbers = new int[9];
    1.37          for (int i = 0 ; i < 9 ; i++) {
    1.38              int l = line[i]-1;

mercurial