Project

General

Profile

« Previous | Next » 

Revision 8db55f55

Added by Leszek Koltunski over 2 years ago

Preparation for unification of scrambling. Scrambling of all objects will be done by a generic funtion, only fed a certain data structure by the objects. The data structure is going to be the ScrambleStateGraph - a directed state graph of all states we can come across while scrambling.

Make the ScrambleStateGraph support any number of axis, not only 3 as it did up till now. Also, correct one problem in BangadageCubeEvil's StageGraph: its state number 114 was incorrect, missing one move.

View differences:

src/main/java/org/distorted/objects/TwistyBandagedEvil.java
21 21

  
22 22
import android.content.res.Resources;
23 23

  
24
import org.distorted.helpers.BandagedState;
24
import org.distorted.helpers.ScrambleStateGraph;
25 25
import org.distorted.library.main.DistortedEffects;
26 26
import org.distorted.library.main.DistortedTexture;
27 27
import org.distorted.library.mesh.MeshSquare;
......
35 35
class TwistyBandagedEvil extends TwistyBandagedAbstract
36 36
{
37 37
   private int mCurrState;
38
   private boolean mUseX;
39
   private boolean mUseY;
40
   private boolean mUseZ;
38
   private int mIndexExcluded;
41 39

  
42 40
   // The list of all 'significant' states of the Evil Cube, just like in the 3Plate Cube class.
43
   // This time the list got computed automatically - by the BandagedStateGraph.computeGraph().
41
   // This time the list got computed automatically - by the ScrambleStateGraphProducer.computeGraph().
44 42

  
45
   private final BandagedState[] mStates = new BandagedState[]
43
   private final ScrambleStateGraph[] mStates = new ScrambleStateGraph[]
46 44
     {
47
     new BandagedState( new int[] {2, 1,  1,2,-1,  2}         , new int[] {2, 2,142,2,-1, 28}         , new int[] {0, 1,114}                   ),
48
     new BandagedState( new int[] {2, 2,  2}                  , new int[] {2,-1,143}                  , null                                   ),
49
     new BandagedState( new int[] {2, 2,  1}                  , null                                  , new int[] {0, 1,  3,0, 2, 47}          ),
50
     new BandagedState( new int[] {2, 1,  4}                  , new int[] {2, 1,132,2,-1,131}         , new int[] {0, 1, 47,0,-1,  2}          ),
51
     new BandagedState( new int[] {2,-1,  3}                  , new int[] {2, 1,  5,2,-1,  6}         , null                                   ),
52
     new BandagedState( null                                  , new int[] {2, 2,  6,2,-1,  4}         , new int[] {0, 1, 51}                   ),
53
     new BandagedState( null                                  , new int[] {2, 1,  4,2, 2,  5}         , new int[] {2, 2,  7,2,-1, 80}          ),
54
     new BandagedState( new int[] {2, 2,  8}                  , null                                  , new int[] {2, 1, 80,2, 2,  6}          ),
55
     new BandagedState( new int[] {2, 2,  7}                  , null                                  , new int[] {0,-1,  9}                   ),
56
     new BandagedState( new int[] {2, 1, 10,2, 2, 11,2,-1, 12}, null                                  , new int[] {0, 1,  8}                   ),
57
     new BandagedState( new int[] {2, 1, 11,2, 2, 12,2,-1,  9}, null                                  , new int[] {0,-1,118}                   ),
58
     new BandagedState( new int[] {2, 1, 12,2, 2,  9,2,-1, 10}, null                                  , new int[] {2, 1, 77}                   ),
59
     new BandagedState( new int[] {2, 1,  9,2, 2, 10,2,-1, 11}, null                                  , new int[] {2, 1, 13,2, 2,143}          ),
60
     new BandagedState( new int[] {2, 1, 14,2, 2, 15,2,-1, 16}, new int[] {2, 1, 57,2,-1, 58}         , new int[] {2, 1,143,2,-1, 12}          ),
61
     new BandagedState( new int[] {2, 1, 15,2, 2, 16,2,-1, 13}, null                                  , new int[] {2, 1, 41}                   ),
62
     new BandagedState( new int[] {2, 1, 16,2, 2, 13,2,-1, 14}, null                                  , new int[] {0, 1, 82}                   ),
63
     new BandagedState( new int[] {2, 1, 13,2, 2, 14,2,-1, 15}, new int[] {2, 1, 17,2,-1, 18}         , new int[] {0, 1,111,0,-1,115}          ),
64
     new BandagedState( null                                  , new int[] {2, 2, 18,2,-1, 16}         , new int[] {0,-1,139}                   ),
65
     new BandagedState( new int[] {2, 1, 19,2,-1, 20}         , new int[] {2, 1, 16,2, 2, 17}         , new int[] {2, 1,142}                   ),
66
     new BandagedState( new int[] {2, 2, 20,2,-1, 18}         , null                                  , new int[] {2, 1, 39,2, 2,140}          ),
67
     new BandagedState( new int[] {2, 1, 18,2, 2, 19}         , new int[] {2, 1, 21}                  , null                                   ),
68
     new BandagedState( null                                  , new int[] {2,-1, 20}                  , new int[] {0,-1, 22}                   ),
69
     new BandagedState( new int[] {2, 2, 23,2,-1, 24}         , null                                  , new int[] {0, 1, 21}                   ),
70
     new BandagedState( new int[] {2, 1, 24,2, 2, 22}         , null                                  , new int[] {2, 1, 92}                   ),
71
     new BandagedState( new int[] {2, 1, 22,2,-1, 23}         , null                                  , new int[] {0, 1, 25}                   ),
72
     new BandagedState( new int[] {2, 1, 26,2, 2, 27}         , null                                  , new int[] {0,-1, 24}                   ),
73
     new BandagedState( new int[] {2, 1, 27,2,-1, 25}         , new int[] {2, 1, 74}                  , null                                   ),
74
     new BandagedState( new int[] {2, 2, 25,2,-1, 26}         , null                                  , new int[] {2, 1, 28,2, 2,124}          ),
75
     new BandagedState( new int[] {2, 1, 29,2, 2, 30,2,-1, 31}, new int[] {2,-1,142}                  , new int[] {2, 1,124,2,-1, 27}          ),
76
     new BandagedState( new int[] {2, 1, 30,2, 2, 31,2,-1, 28}, null                                  , new int[] {2, 1,141}                   ),
77
     new BandagedState( new int[] {2, 1, 31,2, 2, 28,2,-1, 29}, null                                  , new int[] {0, 1,130}                   ),
78
     new BandagedState( new int[] {2, 1, 28,2, 2, 29,2,-1, 30}, new int[] {2, 1, 32,2,-1, 33}         , new int[] {0, 1, 89,0,-1, 90}          ),
79
     new BandagedState( null                                  , new int[] {2, 2, 33,2,-1, 31}         , new int[] {0,-1,137}                   ),
80
     new BandagedState( new int[] {2, 1, 34}                  , new int[] {2, 1, 31,2, 2, 32}         , null                                   ),
81
     new BandagedState( new int[] {2,-1, 33}                  , null                                  , new int[] {2, 1, 35}                   ),
82
     new BandagedState( null                                  , new int[] {2,-1, 36}                  , new int[] {2,-1, 34}                   ),
83
     new BandagedState( null                                  , new int[] {2, 1, 35}                  , new int[] {2,-1, 37}                   ),
84
     new BandagedState( null                                  , new int[] {2, 1, 38,2, 2, 93}         , new int[] {2, 1, 36}                   ),
85
     new BandagedState( new int[] {2, 1, 39}                  , new int[] {2, 1, 93,2,-1, 37}         , null                                   ),
86
     new BandagedState( new int[] {2,-1, 38}                  , new int[] {2, 1, 40,2,-1, 64}         , new int[] {2, 1,140,2,-1, 19}          ),
87
     new BandagedState( new int[] {2, 1, 41,2,-1, 42}         , new int[] {2, 2, 64,2,-1, 39}         , null                                   ),
88
     new BandagedState( new int[] {2, 2, 42,2,-1, 40}         , null                                  , new int[] {2,-1, 14}                   ),
89
     new BandagedState( new int[] {2, 1, 40,2, 2, 41}         , null                                  , new int[] {0, 1, 43,0, 2,128}          ),
90
     new BandagedState( new int[] {2, 1, 44,2,-1, 45}         , new int[] {2, 1,114,2, 2,113,2,-1, 86}, new int[] {0, 1,128,0,-1, 42}          ),
91
     new BandagedState( new int[] {2, 2, 45,2,-1, 43}         , new int[] {2, 1, 48,2,-1,108}         , new int[] {2,-1, 81}                   ),
92
     new BandagedState( new int[] {2, 1, 43,2, 2, 44}         , null                                  , new int[] {0, 1, 46}                   ),
93
     new BandagedState( null                                  , new int[] {2, 1, 47}                  , new int[] {0,-1, 45}                   ),
94
     new BandagedState( null                                  , new int[] {2,-1, 46}                  , new int[] {0, 2,  2,0,-1,  3}          ),
95
     new BandagedState( new int[] {2,-1, 49}                  , new int[] {2, 2,108,2,-1, 44}         , null                                   ),
96
     new BandagedState( new int[] {2, 1, 48}                  , null                                  , new int[] {0, 1, 50}                   ),
97
     new BandagedState( null                                  , new int[] {2, 1, 51,2, 2, 52}         , new int[] {0,-1, 49}                   ),
98
     new BandagedState( null                                  , new int[] {2, 1, 52,2,-1, 50}         , new int[] {0,-1,  5}                   ),
99
     new BandagedState( null                                  , new int[] {2, 2, 50,2,-1, 51}         , new int[] {2,-1, 53}                   ),
100
     new BandagedState( null                                  , new int[] {2, 1, 54,2, 2, 55}         , new int[] {2, 1, 52}                   ),
101
     new BandagedState( null                                  , new int[] {2, 1, 55,2,-1, 53}         , new int[] {0,-1,104}                   ),
102
     new BandagedState( null                                  , new int[] {2, 2, 53,2,-1, 54}         , new int[] {0, 2, 56,0,-1, 65}          ),
103
     new BandagedState( new int[] {2, 1, 57}                  , null                                  , new int[] {0, 1, 65,0, 2, 55}          ),
104
     new BandagedState( new int[] {2,-1, 56}                  , new int[] {2, 2, 58,2,-1, 13}         , null                                   ),
105
     new BandagedState( null                                  , new int[] {2, 1, 13,2, 2, 57}         , new int[] {2,-1, 59}                   ),
106
     new BandagedState( new int[] {2, 1, 60}                  , null                                  , new int[] {2, 1, 58}                   ),
107
     new BandagedState( new int[] {2,-1, 59}                  , null                                  , new int[] {2, 1, 61}                   ),
108
     new BandagedState( new int[] {2,-1, 62}                  , null                                  , new int[] {2,-1, 60}                   ),
109
     new BandagedState( new int[] {2, 1, 61}                  , new int[] {2,-1, 63}                  , null                                   ),
110
     new BandagedState( null                                  , new int[] {2, 1, 62}                  , new int[] {2, 1, 64}                   ),
111
     new BandagedState( null                                  , new int[] {2, 1, 39,2, 2, 40}         , new int[] {2,-1, 63}                   ),
112
     new BandagedState( new int[] {2, 1, 66,2,-1, 67}         , new int[] {2, 1, 78,2, 2, 79,2,-1, 80}, new int[] {0, 1, 55,0,-1, 56}          ),
113
     new BandagedState( new int[] {2, 2, 67,2,-1, 65}         , new int[] {2,-1,107}                  , null                                   ),
114
     new BandagedState( new int[] {2, 1, 65,2, 2, 66}         , null                                  , new int[] {0, 1, 68}                   ),
115
     new BandagedState( null                                  , new int[] {2, 1, 69}                  , new int[] {0,-1, 67}                   ),
116
     new BandagedState( null                                  , new int[] {2,-1, 68}                  , new int[] {0,-1, 70}                   ),
117
     new BandagedState( null                                  , new int[] {2,-1, 71}                  , new int[] {0, 1, 69}                   ),
118
     new BandagedState( new int[] {2,-1, 72}                  , new int[] {2, 1, 70}                  , null                                   ),
119
     new BandagedState( new int[] {2, 1, 71}                  , null                                  , new int[] {0,-1, 73}                   ),
120
     new BandagedState( new int[] {2, 1, 74,2, 2, 75}         , null                                  , new int[] {0, 1, 72}                   ),
121
     new BandagedState( new int[] {2, 1, 75,2,-1, 73}         , new int[] {2,-1, 26}                  , new int[] {0, 1, 83,0,-1,138}          ),
122
     new BandagedState( new int[] {2, 2, 73,2,-1, 74}         , new int[] {2, 1, 76,2,-1, 77}         , null                                   ),
123
     new BandagedState( null                                  , new int[] {2, 2, 77,2,-1, 75}         , new int[] {0, 1, 78}                   ),
124
     new BandagedState( null                                  , new int[] {2, 1, 75,2, 2, 76}         , new int[] {2,-1, 11}                   ),
125
     new BandagedState( null                                  , new int[] {2, 1, 79,2, 2, 80,2,-1, 65}, new int[] {0,-1, 76}                   ),
126
     new BandagedState( null                                  , new int[] {2, 1, 80,2, 2, 65,2,-1, 78}, new int[] {2,-1,110}                   ),
127
     new BandagedState( new int[] {2, 1, 81,2,-1, 82}         , new int[] {2, 1, 65,2, 2, 78,2,-1, 79}, new int[] {2, 1,  6,2,-1,  7}          ),
128
     new BandagedState( new int[] {2, 2, 82,2,-1, 80}         , null                                  , new int[] {2, 1, 44}                   ),
129
     new BandagedState( new int[] {2, 1, 80,2, 2, 81}         , new int[] {2, 1, 83,2,-1, 84}         , new int[] {0,-1, 15}                   ),
130
     new BandagedState( null                                  , new int[] {2, 2, 84,2,-1, 82}         , new int[] {0, 2,138,0,-1, 74}          ),
131
     new BandagedState( new int[] {2, 1, 85}                  , new int[] {2, 1, 82,2, 2, 83}         , null                                   ),
132
     new BandagedState( new int[] {2,-1, 84}                  , null                                  , new int[] {2, 1, 86,2, 2,119}          ),
133
     new BandagedState( new int[] {2, 1, 87,2,-1, 88}         , new int[] {2, 1, 43,2, 2,114,2,-1,113}, new int[] {2, 1,119,2,-1, 85}          ),
134
     new BandagedState( new int[] {2, 2, 88,2,-1, 86}         , null                                  , new int[] {2, 1, 94}                   ),
135
     new BandagedState( new int[] {2, 1, 86,2, 2, 87}         , new int[] {2, 1, 89}                  , null                                   ),
136
     new BandagedState( null                                  , new int[] {2,-1, 88}                  , new int[] {0, 2, 90,0,-1, 31}          ),
137
     new BandagedState( new int[] {2, 1, 91,2, 2, 92}         , null                                  , new int[] {0, 1, 31,0, 2, 89}          ),
138
     new BandagedState( new int[] {2, 1, 92,2,-1, 90}         , null                                  , new int[] {0, 1, 93}                   ),
139
     new BandagedState( new int[] {2, 2, 90,2,-1, 91}         , null                                  , new int[] {2,-1, 23}                   ),
140
     new BandagedState( null                                  , new int[] {2, 2, 37,2,-1, 38}         , new int[] {0,-1, 91}                   ),
141
     new BandagedState( null                                  , new int[] {2,-1, 95}                  , new int[] {2,-1, 87}                   ),
142
     new BandagedState( null                                  , new int[] {2, 1, 94}                  , new int[] {2,-1, 96}                   ),
143
     new BandagedState( null                                  , new int[] {2, 1, 97}                  , new int[] {2, 1, 95}                   ),
144
     new BandagedState( new int[] {2, 1, 98}                  , new int[] {2,-1, 96}                  , null                                   ),
145
     new BandagedState( new int[] {2,-1, 97}                  , null                                  , new int[] {2,-1, 99}                   ),
146
     new BandagedState( new int[] {2, 2,100,2,-1,101}         , null                                  , new int[] {2, 1, 98}                   ),
147
     new BandagedState( new int[] {2, 1,101,2, 2, 99}         , new int[] {2, 1,111,2,-1,112}         , null                                   ),
148
     new BandagedState( new int[] {2, 1, 99,2,-1,100}         , new int[] {2, 1,102}                  , new int[] {2, 1,108,2,-1,109}          ),
149
     new BandagedState( new int[] {2, 1,103,2,-1,104}         , new int[] {2,-1,101}                  , null                                   ),
150
     new BandagedState( new int[] {2, 2,104,2,-1,102}         , null                                  , new int[] {2,-1,105}                   ),
151
     new BandagedState( new int[] {2, 1,102,2, 2,103}         , null                                  , new int[] {0, 1, 54}                   ),
152
     new BandagedState( new int[] {2,-1,106}                  , null                                  , new int[] {2, 1,103}                   ),
153
     new BandagedState( new int[] {2, 1,105}                  , null                                  , new int[] {2, 1,107}                   ),
154
     new BandagedState( null                                  , new int[] {2, 1, 66}                  , new int[] {2,-1,106}                   ),
155
     new BandagedState( null                                  , new int[] {2, 1, 44,2, 2, 48}         , new int[] {2, 2,109,2,-1,101}          ),
156
     new BandagedState( new int[] {2,-1,110}                  , null                                  , new int[] {2, 1,101,2, 2,108}          ),
157
     new BandagedState( new int[] {2, 1,109}                  , null                                  , new int[] {2, 1, 79}                   ),
158
     new BandagedState( null                                  , new int[] {2, 2,112,2,-1,100}         , new int[] {0, 2,115,0,-1, 16}          ),
159
     new BandagedState( null                                  , new int[] {2, 1,100,2, 2,111}         , new int[] {2, 1,113}                   ),
160
     new BandagedState( null                                  , new int[] {2, 1, 86,2, 2, 43,2,-1,114}, new int[] {2,-1,112}                   ),
161
     new BandagedState( null                                  , new int[] {2, 1,113,2, 2, 86,2,-1, 43}, null                                   ),
162
     new BandagedState( new int[] {2, 2,116}                  , null                                  , new int[] {0, 1, 16,0, 2,111}          ),
163
     new BandagedState( new int[] {2, 2,115}                  , null                                  , new int[] {2,-1,117}                   ),
164
     new BandagedState( new int[] {2, 1,118}                  , null                                  , new int[] {2, 1,116}                   ),
165
     new BandagedState( new int[] {2,-1,117}                  , null                                  , new int[] {0, 1, 10}                   ),
166
     new BandagedState( null                                  , new int[] {2, 1,120,2, 2,121,2,-1,122}, new int[] {2, 2, 85,2,-1, 86}          ),
167
     new BandagedState( null                                  , new int[] {2, 1,121,2, 2,122,2,-1,119}, new int[] {2,-1,129}                   ),
168
     new BandagedState( null                                  , new int[] {2, 1,122,2, 2,119,2,-1,120}, new int[] {0, 1,125}                   ),
169
     new BandagedState( null                                  , new int[] {2, 1,119,2, 2,120,2,-1,121}, new int[] {0,-1,123}                   ),
170
     new BandagedState( null                                  , new int[] {2, 2,124}                  , new int[] {0, 1,122}                   ),
171
     new BandagedState( null                                  , new int[] {2, 2,123}                  , new int[] {2, 2, 27,2,-1, 28}          ),
172
     new BandagedState( null                                  , new int[] {2, 1,126}                  , new int[] {0,-1,121}                   ),
173
     new BandagedState( null                                  , new int[] {2,-1,125}                  , new int[] {2,-1,127}                   ),
174
     new BandagedState( null                                  , new int[] {2, 2,128}                  , new int[] {2, 1,126}                   ),
175
     new BandagedState( null                                  , new int[] {2, 2,127}                  , new int[] {0, 2, 42,0,-1, 43}          ),
176
     new BandagedState( new int[] {2, 2,130,2,-1,131}         , null                                  , new int[] {2, 1,120}                   ),
177
     new BandagedState( new int[] {2, 1,131,2, 2,129}         , null                                  , new int[] {0,-1, 30}                   ),
178
     new BandagedState( new int[] {2, 1,129,2,-1,130}         , new int[] {2, 1,  3,2, 2,132}         , null                                   ),
179
     new BandagedState( null                                  , new int[] {2, 2,131,2,-1,  3}         , new int[] {0,-1,133}                   ),
180
     new BandagedState( null                                  , new int[] {2,-1,134}                  , new int[] {0, 1,132}                   ),
181
     new BandagedState( new int[] {2,-1,135}                  , new int[] {2, 1,133}                  , null                                   ),
182
     new BandagedState( new int[] {2, 1,134}                  , null                                  , new int[] {0,-1,136}                   ),
183
     new BandagedState( new int[] {2, 1,137}                  , null                                  , new int[] {0, 1,135}                   ),
184
     new BandagedState( new int[] {2,-1,136}                  , null                                  , new int[] {0, 1, 32}                   ),
185
     new BandagedState( new int[] {2, 1,139}                  , null                                  , new int[] {0, 1, 74,0, 2, 83}          ),
186
     new BandagedState( new int[] {2,-1,138}                  , null                                  , new int[] {0, 1, 17}                   ),
187
     new BandagedState( null                                  , new int[] {2, 1,141}                  , new int[] {2, 2, 19,2,-1, 39}          ),
188
     new BandagedState( null                                  , new int[] {2,-1,140}                  , new int[] {2,-1, 29}                   ),
189
     new BandagedState( null                                  , new int[] {2, 1, 28}                  , new int[] {2,-1, 18}                   ),
190
     new BandagedState( null                                  , new int[] {2, 1,  1}                  , new int[] {2, 2, 12,2,-1, 13}          )
45
     new ScrambleStateGraph( new int[][] {{2, 1,  1,2,-1,  2}         , {2, 2,142,2,-1, 28}         , {0, 1,114}          }),   //0
46
     new ScrambleStateGraph( new int[][] {{2, 2,  2}                  , {2,-1,143}                  , {}                  }),
47
     new ScrambleStateGraph( new int[][] {{2, 2,  1}                  , {}                          , {0, 1,  3,0, 2, 47} }),
48
     new ScrambleStateGraph( new int[][] {{2, 1,  4}                  , {2, 1,132,2,-1,131}         , {0, 1, 47,0,-1,  2} }),
49
     new ScrambleStateGraph( new int[][] {{2,-1,  3}                  , {2, 1,  5,2,-1,  6}         , {}                  }),
50
     new ScrambleStateGraph( new int[][] {{}                          , {2, 2,  6,2,-1,  4}         , {0, 1, 51}          }),
51
     new ScrambleStateGraph( new int[][] {{}                          , {2, 1,  4,2, 2,  5}         , {2, 2,  7,2,-1, 80} }),
52
     new ScrambleStateGraph( new int[][] {{2, 2,  8}                  , {}                          , {2, 1, 80,2, 2,  6} }),
53
     new ScrambleStateGraph( new int[][] {{2, 2,  7}                  , {}                          , {0,-1,  9}          }),
54
     new ScrambleStateGraph( new int[][] {{2, 1, 10,2, 2, 11,2,-1, 12}, {}                          , {0, 1,  8}          }),
55
     new ScrambleStateGraph( new int[][] {{2, 1, 11,2, 2, 12,2,-1,  9}, {}                          , {0,-1,118}          }),   //10
56
     new ScrambleStateGraph( new int[][] {{2, 1, 12,2, 2,  9,2,-1, 10}, {}                          , {2, 1, 77}          }),
57
     new ScrambleStateGraph( new int[][] {{2, 1,  9,2, 2, 10,2,-1, 11}, {}                          , {2, 1, 13,2, 2,143} }),
58
     new ScrambleStateGraph( new int[][] {{2, 1, 14,2, 2, 15,2,-1, 16}, {2, 1, 57,2,-1, 58}         , {2, 1,143,2,-1, 12} }),
59
     new ScrambleStateGraph( new int[][] {{2, 1, 15,2, 2, 16,2,-1, 13}, {}                          , {2, 1, 41}          }),
60
     new ScrambleStateGraph( new int[][] {{2, 1, 16,2, 2, 13,2,-1, 14}, {}                          , {0, 1, 82}          }),
61
     new ScrambleStateGraph( new int[][] {{2, 1, 13,2, 2, 14,2,-1, 15}, {2, 1, 17,2,-1, 18}         , {0, 1,111,0,-1,115} }),
62
     new ScrambleStateGraph( new int[][] {{}                          , {2, 2, 18,2,-1, 16}         , {0,-1,139}          }),
63
     new ScrambleStateGraph( new int[][] {{2, 1, 19,2,-1, 20}         , {2, 1, 16,2, 2, 17}         , {2, 1,142}          }),
64
     new ScrambleStateGraph( new int[][] {{2, 2, 20,2,-1, 18}         , {}                          , {2, 1, 39,2, 2,140} }),
65
     new ScrambleStateGraph( new int[][] {{2, 1, 18,2, 2, 19}         , {2, 1, 21}                  , {}                  }),   //20
66
     new ScrambleStateGraph( new int[][] {{}                          , {2,-1, 20}                  , {0,-1, 22}          }),
67
     new ScrambleStateGraph( new int[][] {{2, 2, 23,2,-1, 24}         , {}                          , {0, 1, 21}          }),
68
     new ScrambleStateGraph( new int[][] {{2, 1, 24,2, 2, 22}         , {}                          , {2, 1, 92}          }),
69
     new ScrambleStateGraph( new int[][] {{2, 1, 22,2,-1, 23}         , {}                          , {0, 1, 25}          }),
70
     new ScrambleStateGraph( new int[][] {{2, 1, 26,2, 2, 27}         , {}                          , {0,-1, 24}          }),
71
     new ScrambleStateGraph( new int[][] {{2, 1, 27,2,-1, 25}         , {2, 1, 74}                  , {}                  }),
72
     new ScrambleStateGraph( new int[][] {{2, 2, 25,2,-1, 26}         , {}                          , {2, 1, 28,2, 2,124} }),
73
     new ScrambleStateGraph( new int[][] {{2, 1, 29,2, 2, 30,2,-1, 31}, {2,-1,142}                  , {2, 1,124,2,-1, 27} }),
74
     new ScrambleStateGraph( new int[][] {{2, 1, 30,2, 2, 31,2,-1, 28}, {}                          , {2, 1,141}          }),
75
     new ScrambleStateGraph( new int[][] {{2, 1, 31,2, 2, 28,2,-1, 29}, {}                          , {0, 1,130}          }),   //30
76
     new ScrambleStateGraph( new int[][] {{2, 1, 28,2, 2, 29,2,-1, 30}, {2, 1, 32,2,-1, 33}         , {0, 1, 89,0,-1, 90} }),
77
     new ScrambleStateGraph( new int[][] {{}                          , {2, 2, 33,2,-1, 31}         , {0,-1,137}          }),
78
     new ScrambleStateGraph( new int[][] {{2, 1, 34}                  , {2, 1, 31,2, 2, 32}         , {}                  }),
79
     new ScrambleStateGraph( new int[][] {{2,-1, 33}                  , {}                          , {2, 1, 35}          }),
80
     new ScrambleStateGraph( new int[][] {{}                          , {2,-1, 36}                  , {2,-1, 34}          }),
81
     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 35}                  , {2,-1, 37}          }),
82
     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 38,2, 2, 93}         , {2, 1, 36}          }),
83
     new ScrambleStateGraph( new int[][] {{2, 1, 39}                  , {2, 1, 93,2,-1, 37}         , {}                  }),
84
     new ScrambleStateGraph( new int[][] {{2,-1, 38}                  , {2, 1, 40,2,-1, 64}         , {2, 1,140,2,-1, 19} }),
85
     new ScrambleStateGraph( new int[][] {{2, 1, 41,2,-1, 42}         , {2, 2, 64,2,-1, 39}         , {}                  }),   //40
86
     new ScrambleStateGraph( new int[][] {{2, 2, 42,2,-1, 40}         , {}                          , {2,-1, 14}          }),
87
     new ScrambleStateGraph( new int[][] {{2, 1, 40,2, 2, 41}         , {}                          , {0, 1, 43,0, 2,128} }),
88
     new ScrambleStateGraph( new int[][] {{2, 1, 44,2,-1, 45}         , {2, 1,114,2, 2,113,2,-1, 86}, {0, 1,128,0,-1, 42} }),
89
     new ScrambleStateGraph( new int[][] {{2, 2, 45,2,-1, 43}         , {2, 1, 48,2,-1,108}         , {2,-1, 81}          }),
90
     new ScrambleStateGraph( new int[][] {{2, 1, 43,2, 2, 44}         , {}                          , {0, 1, 46}          }),
91
     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 47}                  , {0,-1, 45}          }),
92
     new ScrambleStateGraph( new int[][] {{}                          , {2,-1, 46}                  , {0, 2,  2,0,-1,  3} }),
93
     new ScrambleStateGraph( new int[][] {{2,-1, 49}                  , {2, 2,108,2,-1, 44}         , {}                  }),
94
     new ScrambleStateGraph( new int[][] {{2, 1, 48}                  , {}                          , {0, 1, 50}          }),
95
     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 51,2, 2, 52}         , {0,-1, 49}          }),   //50
96
     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 52,2,-1, 50}         , {0,-1,  5}          }),
97
     new ScrambleStateGraph( new int[][] {{}                          , {2, 2, 50,2,-1, 51}         , {2,-1, 53}          }),
98
     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 54,2, 2, 55}         , {2, 1, 52}          }),
99
     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 55,2,-1, 53}         , {0,-1,104}          }),
100
     new ScrambleStateGraph( new int[][] {{}                          , {2, 2, 53,2,-1, 54}         , {0, 2, 56,0,-1, 65} }),
101
     new ScrambleStateGraph( new int[][] {{2, 1, 57}                  , {}                          , {0, 1, 65,0, 2, 55} }),
102
     new ScrambleStateGraph( new int[][] {{2,-1, 56}                  , {2, 2, 58,2,-1, 13}         , {}                  }),
103
     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 13,2, 2, 57}         , {2,-1, 59}          }),
104
     new ScrambleStateGraph( new int[][] {{2, 1, 60}                  , {}                          , {2, 1, 58}          }),
105
     new ScrambleStateGraph( new int[][] {{2,-1, 59}                  , {}                          , {2, 1, 61}          }),   //60
106
     new ScrambleStateGraph( new int[][] {{2,-1, 62}                  , {}                          , {2,-1, 60}          }),
107
     new ScrambleStateGraph( new int[][] {{2, 1, 61}                  , {2,-1, 63}                  , {}                  }),
108
     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 62}                  , {2, 1, 64}          }),
109
     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 39,2, 2, 40}         , {2,-1, 63}          }),
110
     new ScrambleStateGraph( new int[][] {{2, 1, 66,2,-1, 67}         , {2, 1, 78,2, 2, 79,2,-1, 80}, {0, 1, 55,0,-1, 56} }),
111
     new ScrambleStateGraph( new int[][] {{2, 2, 67,2,-1, 65}         , {2,-1,107}                  , {}                  }),
112
     new ScrambleStateGraph( new int[][] {{2, 1, 65,2, 2, 66}         , {}                          , {0, 1, 68}          }),
113
     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 69}                  , {0,-1, 67}          }),
114
     new ScrambleStateGraph( new int[][] {{}                          , {2,-1, 68}                  , {0,-1, 70}          }),
115
     new ScrambleStateGraph( new int[][] {{}                          , {2,-1, 71}                  , {0, 1, 69}          }),   //70
116
     new ScrambleStateGraph( new int[][] {{2,-1, 72}                  , {2, 1, 70}                  , {}                  }),
117
     new ScrambleStateGraph( new int[][] {{2, 1, 71}                  , {}                          , {0,-1, 73}          }),
118
     new ScrambleStateGraph( new int[][] {{2, 1, 74,2, 2, 75}         , {}                          , {0, 1, 72}          }),
119
     new ScrambleStateGraph( new int[][] {{2, 1, 75,2,-1, 73}         , {2,-1, 26}                  , {0, 1, 83,0,-1,138} }),
120
     new ScrambleStateGraph( new int[][] {{2, 2, 73,2,-1, 74}         , {2, 1, 76,2,-1, 77}         , {}                  }),
121
     new ScrambleStateGraph( new int[][] {{}                          , {2, 2, 77,2,-1, 75}         , {0, 1, 78}          }),
122
     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 75,2, 2, 76}         , {2,-1, 11}          }),
123
     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 79,2, 2, 80,2,-1, 65}, {0,-1, 76}          }),
124
     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 80,2, 2, 65,2,-1, 78}, {2,-1,110}          }),
125
     new ScrambleStateGraph( new int[][] {{2, 1, 81,2,-1, 82}         , {2, 1, 65,2, 2, 78,2,-1, 79}, {2, 1,  6,2,-1,  7} }),   //80
126
     new ScrambleStateGraph( new int[][] {{2, 2, 82,2,-1, 80}         , {}                          , {2, 1, 44}          }),
127
     new ScrambleStateGraph( new int[][] {{2, 1, 80,2, 2, 81}         , {2, 1, 83,2,-1, 84}         , {0,-1, 15}          }),
128
     new ScrambleStateGraph( new int[][] {{}                          , {2, 2, 84,2,-1, 82}         , {0, 2,138,0,-1, 74} }),
129
     new ScrambleStateGraph( new int[][] {{2, 1, 85}                  , {2, 1, 82,2, 2, 83}         , {}                  }),
130
     new ScrambleStateGraph( new int[][] {{2,-1, 84}                  , {}                          , {2, 1, 86,2, 2,119} }),
131
     new ScrambleStateGraph( new int[][] {{2, 1, 87,2,-1, 88}         , {2, 1, 43,2, 2,114,2,-1,113}, {2, 1,119,2,-1, 85} }),
132
     new ScrambleStateGraph( new int[][] {{2, 2, 88,2,-1, 86}         , {}                          , {2, 1, 94}          }),
133
     new ScrambleStateGraph( new int[][] {{2, 1, 86,2, 2, 87}         , {2, 1, 89}                  , {}                  }),
134
     new ScrambleStateGraph( new int[][] {{}                          , {2,-1, 88}                  , {0, 2, 90,0,-1, 31} }),
135
     new ScrambleStateGraph( new int[][] {{2, 1, 91,2, 2, 92}         , {}                          , {0, 1, 31,0, 2, 89} }),   //90
136
     new ScrambleStateGraph( new int[][] {{2, 1, 92,2,-1, 90}         , {}                          , {0, 1, 93}          }),
137
     new ScrambleStateGraph( new int[][] {{2, 2, 90,2,-1, 91}         , {}                          , {2,-1, 23}          }),
138
     new ScrambleStateGraph( new int[][] {{}                          , {2, 2, 37,2,-1, 38}         , {0,-1, 91}          }),
139
     new ScrambleStateGraph( new int[][] {{}                          , {2,-1, 95}                  , {2,-1, 87}          }),
140
     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 94}                  , {2,-1, 96}          }),
141
     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 97}                  , {2, 1, 95}          }),
142
     new ScrambleStateGraph( new int[][] {{2, 1, 98}                  , {2,-1, 96}                  , {}                  }),
143
     new ScrambleStateGraph( new int[][] {{2,-1, 97}                  , {}                          , {2,-1, 99}          }),
144
     new ScrambleStateGraph( new int[][] {{2, 2,100,2,-1,101}         , {}                          , {2, 1, 98}          }),
145
     new ScrambleStateGraph( new int[][] {{2, 1,101,2, 2, 99}         , {2, 1,111,2,-1,112}         , {}                  }),   //100
146
     new ScrambleStateGraph( new int[][] {{2, 1, 99,2,-1,100}         , {2, 1,102}                  , {2, 1,108,2,-1,109} }),
147
     new ScrambleStateGraph( new int[][] {{2, 1,103,2,-1,104}         , {2,-1,101}                  , {}                  }),
148
     new ScrambleStateGraph( new int[][] {{2, 2,104,2,-1,102}         , {}                          , {2,-1,105}          }),
149
     new ScrambleStateGraph( new int[][] {{2, 1,102,2, 2,103}         , {}                          , {0, 1, 54}          }),
150
     new ScrambleStateGraph( new int[][] {{2,-1,106}                  , {}                          , {2, 1,103}          }),
151
     new ScrambleStateGraph( new int[][] {{2, 1,105}                  , {}                          , {2, 1,107}          }),
152
     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 66}                  , {2,-1,106}          }),
153
     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 44,2, 2, 48}         , {2, 2,109,2,-1,101} }),
154
     new ScrambleStateGraph( new int[][] {{2,-1,110}                  , {}                          , {2, 1,101,2, 2,108} }),
155
     new ScrambleStateGraph( new int[][] {{2, 1,109}                  , {}                          , {2, 1, 79}          }),   //110
156
     new ScrambleStateGraph( new int[][] {{}                          , {2, 2,112,2,-1,100}         , {0, 2,115,0,-1, 16} }),
157
     new ScrambleStateGraph( new int[][] {{}                          , {2, 1,100,2, 2,111}         , {2, 1,113}          }),
158
     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 86,2, 2, 43,2,-1,114}, {2,-1,112}          }),
159
     new ScrambleStateGraph( new int[][] {{}                          , {2, 1,113,2, 2, 86,2,-1, 43}, {0,-1,  0}          }),
160
     new ScrambleStateGraph( new int[][] {{2, 2,116}                  , {}                          , {0, 1, 16,0, 2,111} }),
161
     new ScrambleStateGraph( new int[][] {{2, 2,115}                  , {}                          , {2,-1,117}          }),
162
     new ScrambleStateGraph( new int[][] {{2, 1,118}                  , {}                          , {2, 1,116}          }),
163
     new ScrambleStateGraph( new int[][] {{2,-1,117}                  , {}                          , {0, 1, 10}          }),
164
     new ScrambleStateGraph( new int[][] {{}                          , {2, 1,120,2, 2,121,2,-1,122}, {2, 2, 85,2,-1, 86} }),
165
     new ScrambleStateGraph( new int[][] {{}                          , {2, 1,121,2, 2,122,2,-1,119}, {2,-1,129}          }),   //120
166
     new ScrambleStateGraph( new int[][] {{}                          , {2, 1,122,2, 2,119,2,-1,120}, {0, 1,125}          }),
167
     new ScrambleStateGraph( new int[][] {{}                          , {2, 1,119,2, 2,120,2,-1,121}, {0,-1,123}          }),
168
     new ScrambleStateGraph( new int[][] {{}                          , {2, 2,124}                  , {0, 1,122}          }),
169
     new ScrambleStateGraph( new int[][] {{}                          , {2, 2,123}                  , {2, 2, 27,2,-1, 28} }),
170
     new ScrambleStateGraph( new int[][] {{}                          , {2, 1,126}                  , {0,-1,121}          }),
171
     new ScrambleStateGraph( new int[][] {{}                          , {2,-1,125}                  , {2,-1,127}          }),
172
     new ScrambleStateGraph( new int[][] {{}                          , {2, 2,128}                  , {2, 1,126}          }),
173
     new ScrambleStateGraph( new int[][] {{}                          , {2, 2,127}                  , {0, 2, 42,0,-1, 43} }),
174
     new ScrambleStateGraph( new int[][] {{2, 2,130,2,-1,131}         , {}                          , {2, 1,120}          }),
175
     new ScrambleStateGraph( new int[][] {{2, 1,131,2, 2,129}         , {}                          , {0,-1, 30}          }),   //130
176
     new ScrambleStateGraph( new int[][] {{2, 1,129,2,-1,130}         , {2, 1,  3,2, 2,132}         , {}                  }),
177
     new ScrambleStateGraph( new int[][] {{}                          , {2, 2,131,2,-1,  3}         , {0,-1,133}          }),
178
     new ScrambleStateGraph( new int[][] {{}                          , {2,-1,134}                  , {0, 1,132}          }),
179
     new ScrambleStateGraph( new int[][] {{2,-1,135}                  , {2, 1,133}                  , {}                  }),
180
     new ScrambleStateGraph( new int[][] {{2, 1,134}                  , {}                          , {0,-1,136}          }),
181
     new ScrambleStateGraph( new int[][] {{2, 1,137}                  , {}                          , {0, 1,135}          }),
182
     new ScrambleStateGraph( new int[][] {{2,-1,136}                  , {}                          , {0, 1, 32}          }),
183
     new ScrambleStateGraph( new int[][] {{2, 1,139}                  , {}                          , {0, 1, 74,0, 2, 83} }),
184
     new ScrambleStateGraph( new int[][] {{2,-1,138}                  , {}                          , {0, 1, 17}          }),
185
     new ScrambleStateGraph( new int[][] {{}                          , {2, 1,141}                  , {2, 2, 19,2,-1, 39} }),   //140
186
     new ScrambleStateGraph( new int[][] {{}                          , {2,-1,140}                  , {2,-1, 29}          }),
187
     new ScrambleStateGraph( new int[][] {{}                          , {2, 1, 28}                  , {2,-1, 18}          }),
188
     new ScrambleStateGraph( new int[][] {{}                          , {2, 1,  1}                  , {2, 2, 12,2,-1, 13} })
191 189
     };
192 190

  
193 191
///////////////////////////////////////////////////////////////////////////////////////////////////
......
241 239
    {
242 240
    if( curr==0 )
243 241
      {
244
      mCurrState = 0;
245
      mUseX = true;
246
      mUseY = true;
247
      mUseZ = true;
242
      mCurrState     = 0;
243
      mIndexExcluded =-1;
248 244
      }
249 245

  
250
    int total = mStates[mCurrState].getTotal(mUseX,mUseY,mUseZ);
246
    int total = mStates[mCurrState].getTotal(mIndexExcluded);
251 247
    int random= rnd.nextInt(total);
252
    int[] info= mStates[mCurrState].getInfo(random,mUseX,mUseY,mUseZ);
248
    int[] info= mStates[mCurrState].getInfo(random,mIndexExcluded);
253 249

  
254 250
    scramble[curr][0] = info[0];
255 251
    scramble[curr][1] = info[1];
256 252
    scramble[curr][2] = info[2];
257 253

  
258
    mCurrState = info[3];
259

  
260
    switch(info[0])
261
      {
262
      case 0: mUseX = false; mUseY = true ; mUseZ = true ; break;
263
      case 1: mUseX = true ; mUseY = false; mUseZ = true ; break;
264
      case 2: mUseX = true ; mUseY = true ; mUseZ = false; break;
265
      }
254
    mCurrState     = info[3];
255
    mIndexExcluded = info[0];
266 256
    }
267 257

  
268 258
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff