/
SimpleWalker.java
39 lines (28 loc) · 949 Bytes
/
SimpleWalker.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
30
31
32
33
34
35
36
37
38
39
package com.seefoxrun.rubiks.apps.walker.simple;
import com.seefoxrun.rubiks.apps.visualization.GenerateRadialPDF.CurrentClassGetter;
import com.seefoxrun.rubiks.model.cube.*;
import com.seefoxrun.rubiks.model.stateful.tree.AdvancementStats;
import com.seefoxrun.rubiks.model.stateful.tree.SolutionTree;
public class SimpleWalker {
private SolutionTree tree;
public SimpleWalker(int size) {
Cube c = Cube.createCube(size);
tree = new SolutionTree(c);
}
public void process() {
AdvancementStats stats = null;
while (true) {
stats = tree.advanceTree();
if (stats == null)
break;
System.out.println(stats);
}
}
public static void main(String[] args) {
new SimpleWalker(2).process();
}
public static String usage() {
String pname = new CurrentClassGetter().getClassName();
return String.format("Usage: %s [-d <output directory>] [-l <start>[:<end>]] [--spatial] [--colormap] [--reverse]%n", pname);
}
}