-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMAIN.java
More file actions
29 lines (20 loc) · 715 Bytes
/
MAIN.java
File metadata and controls
29 lines (20 loc) · 715 Bytes
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
import java.util.ArrayList;
public class MAIN {
public static void main(String args[]) {
/*MagicSquare m1 = new RandomMagicSquare(3);
MagicSquare m2 = new DiagonalMagicSquare(4);
System.out.println("Random solving - n = 3");
m1.generate();
System.out.println();
System.out.println("Diagonal reverse solving, n = 4");
m2.generate();
MagicSquare m3 = new OptimizedMagicSquare(4);
m3.generate();*/
TreeMagicSquare tree = new TreeMagicSquare(4);
long startTime = System.currentTimeMillis();
tree.generate();
long end = System.currentTimeMillis();
System.out.println("Solutions: " + tree.getCpt());
System.out.println("Time: " + (end - startTime) / 1000 + "s");
}
}