Line | |
---|
1 | package eu.hsrw.tr.prog.vl.arrays; |
---|
2 | |
---|
3 | import java.io.File; |
---|
4 | import java.io.FileNotFoundException; |
---|
5 | import java.util.Scanner; |
---|
6 | |
---|
7 | import eu.hsrw.tr.prog.weitere.fileio.TextFile; |
---|
8 | |
---|
9 | public class Run17 { |
---|
10 | |
---|
11 | public static void main(String[] args) throws FileNotFoundException { |
---|
12 | File f = new File("src/eu/hsrw/tr/prog/arrays/sudoku17.txt"); |
---|
13 | |
---|
14 | TextFile.clearRAFile("src/eu/hsrw/tr/prog/arrays/sudoku17r.txt"); |
---|
15 | |
---|
16 | Scanner input = new Scanner(f); |
---|
17 | |
---|
18 | int i = 0; |
---|
19 | |
---|
20 | while (input.hasNextLine()) { |
---|
21 | i++; |
---|
22 | SudokuHelper.loopCount = 0; |
---|
23 | |
---|
24 | String sudoku = input.nextLine(); |
---|
25 | int[][] a = SudokuHelper.parseSudokuString(sudoku); |
---|
26 | |
---|
27 | long start = System.currentTimeMillis(); |
---|
28 | SudokuSolverLogic.solve(a); |
---|
29 | String info = SudokuSolverBF.solve(a); |
---|
30 | long t = System.currentTimeMillis() - start; |
---|
31 | |
---|
32 | String output = i + ";" + t + ";" + info; |
---|
33 | |
---|
34 | System.out.println(i + ": t: " + t + " Info: " + info); |
---|
35 | TextFile.appendRAFile("src/eu/hsrw/tr/prog/arrays/sudoku17r.txt", output + "\n"); |
---|
36 | } |
---|
37 | |
---|
38 | input.close(); |
---|
39 | } |
---|
40 | |
---|
41 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.