Changeset 435 in Java_Quellcode_SOOP_Vorlesung
- Timestamp:
- Feb 14, 2020, 3:09:50 PM (5 years ago)
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
arrays/SudokuSolver.java
r414 r435 206 206 }; 207 207 208 int[][] sError = { 209 {-4, -7, 0, 3, 0, -2, 0, -6, 0}, 210 {0, 0, -9, 0, 0, 0, -2, 0, 0}, 211 {0, -8, 0, 0, 0, 0, -7, 0, 0}, 212 {0, -5, 0, 0, -1, -9, 0, 0, 0}, 213 {0, 0, 0, -6, 0, -5, 0, 0, 0}, 214 {0, 0, 0, -2, -8, 0, 0, -5, 0}, 215 {0, 0, -3, 0, 0, 0, 0, -9, 0}, 216 {0, 0, -2, 0, 0, 0, -8, 0, 0}, 217 {0, -4, 0, -8, 0, -6, 0, -7, -2}, 218 }; 219 /* 220 [4, 7, 1, 3, 2, 2, 5, 6, 9] 221 [3, 6, 9, 4, 5, 7, 2, 1, 8] 222 [2, 8, 5, 9, 6, 1, 7, 4, 3] 223 [6, 5, 8, 7, 1, 9, 3, 2, 4] 224 [1, 2, 4, 6, 3, 5, 9, 8, 7] 225 [9, 3, 7, 2, 8, 4, 6, 5, 1] 226 [8, 1, 3, 5, 7, 6, 4, 9, 2] 227 [5, 9, 2, 1, 4, 3, 8, 7, 6] 228 [7, 4, 6, 8, 9, 6, 1, 7, 2] 229 */ 230 208 231 int[][] sudoku; 209 232 sudoku = sudokuSchnell; 210 233 sudoku = sudokuLangsam; 234 sudoku = sError; 211 235 // sudoku = sudokuLeer; 212 236 -
arrays/sudokuextra/SudokuSolverLogic.java
r237 r435 160 160 public static void main(String[] args) { 161 161 162 int[][] sudoku = parseSudokuString(SudokuPuzzles.sExtreme2); 162 String puzzle = SudokuPuzzles.sLangsam; 163 int[][] sLogic = parseSudokuString(puzzle); 164 int[][] sBrute = parseSudokuString(puzzle); 163 165 164 printSudoku(s udoku);166 printSudoku(sLogic); 165 167 166 solve(sudoku); 168 long start = System.currentTimeMillis(); 169 solve(sLogic); 170 printSudoku(sLogic); 171 SudokuSolverBF.solve(sLogic); 172 System.out.println("time logic: " + (System.currentTimeMillis() - start)); 173 174 printSudoku(sLogic); 175 176 start = System.currentTimeMillis(); 177 SudokuSolverBF.solve(sBrute); 178 System.out.println("time brute: " + (System.currentTimeMillis() - start)); 167 179 168 printSudoku(s udoku);180 printSudoku(sBrute); 169 181 170 SudokuSolverBF.solve(sudoku);171 172 printSudoku(sudoku);173 182 } 174 183 } -
rekursion/SudokuSolverRekursiv.java
r396 r435 102 102 // Durch den rekursiven Aufruf dieser Methode kehrt return einen Schritt 103 103 // nach oben zurück. Dort war die Position noch um 1 kleiner, es wird 104 // also nach vorn geg eangen.104 // also nach vorn gegangen. 105 105 a[zeile][spalte] = 0; 106 106 return false;
Note: See TracChangeset
for help on using the changeset viewer.