-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSudokuMain.java
29 lines (27 loc) · 1.12 KB
/
SudokuMain.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
public class SudokuMain {
public static void main(String[] args) throws InterruptedException {
int[][] grid = { { 8, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 3, 6, 0, 0, 0, 0, 0 },
{ 0, 7, 0, 0, 9, 0, 2, 0, 0 },
{ 0, 5, 0, 0, 0, 7, 0, 0, 0 },
{ 0, 0, 0, 0, 4, 5, 7, 0, 0 },
{ 0, 0, 0, 1, 0, 0, 0, 3, 0 },
{ 0, 0, 1, 0, 0, 0, 0, 6, 8 },
{ 0, 0, 8, 5, 0, 0, 0, 1, 0 },
{ 0, 9, 0, 0, 0, 0, 4, 0, 0 } };
// creates visual
SudokuBoard newBoard = new SudokuBoard(grid);
newBoard.showboard();
// adds back end solving function
SudokuSolver1 solver = new SudokuSolver1(grid);
// VisualSolver solver = new VisualSolver(grid);
solver.addBoard(newBoard);
long start = System.currentTimeMillis();
solver.solver();
long end = System.currentTimeMillis();
long elapsedTime = end - start;
solver.addFieldAction();
solver.solveButtonAction();
System.out.println(elapsedTime);
}
}