forked from clementgallet/FiveStage444
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTest.java
61 lines (43 loc) · 1.17 KB
/
Test.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package cg.fivestage444;
import java.util.Random;
import java.util.Set;
import java.util.HashSet;
import java.util.Iterator;
public final class Test {
public static void main(String[] args){
//Tools.init();
Symmetry.init();
Util.init();
CubePack.init();
testPack();
}
public static void randomScramble(CubeState cube, Random gen){
cube.init();
for( int i=0; i < 100; i++ ){
cube.move(gen.nextInt(Moves.N_MOVES));
}
}
private static void randomScramble(CubeState cube, byte[] moves, int length, Random gen){
cube.init();
for( int i=0; i < 100; i++ ){
cube.move(moves[gen.nextInt(length)]);
}
}
private static void testPack(){
Random gen = new Random();
CubeState cube1 = new CubeState();
CubeState cube2 = new CubeState();
CubePack cp1 = new CubePack();
CubePack cp2 = new CubePack();
CubePack cp3 = new CubePack();
/* Do one move on the cube and on the cubepack, and compare the two */
randomScramble( cube1, Moves.stage2moves, 28, gen );
cp1.pack( cube1 );
int move = gen.nextInt(Moves.N_STAGE_MOVES);
cube1.move(Moves.stage2moves[move]);
cp1.moveTo(move, cp2);
cp3.pack( cube1 );
cp2.print();
cp3.print();
}
}