Revision 6cf89a3e
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/objects/TwistyCube.java | ||
---|---|---|
23 | 23 |
|
24 | 24 |
import org.distorted.helpers.ObjectShape; |
25 | 25 |
import org.distorted.helpers.ObjectSticker; |
26 |
import org.distorted.helpers.ScrambleStateGraph;
|
|
26 |
import org.distorted.helpers.ScrambleState; |
|
27 | 27 |
import org.distorted.library.main.DistortedEffects; |
28 | 28 |
import org.distorted.library.main.DistortedTexture; |
29 | 29 |
import org.distorted.library.mesh.MeshSquare; |
... | ... | |
131 | 131 |
|
132 | 132 |
private int mCurrState; |
133 | 133 |
private int mIndexExcluded; |
134 |
private final ScrambleStateGraph[] mStates;
|
|
134 |
private final ScrambleState[] mStates; |
|
135 | 135 |
|
136 | 136 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
137 | 137 |
|
... | ... | |
143 | 143 |
int[][] m = new int[16][]; |
144 | 144 |
for(int i=1; i<16; i++) m[i] = createEdges(size,i); |
145 | 145 |
|
146 |
mStates = new ScrambleStateGraph[] // built so that all 3 axes must be present in every 4 consecutive moves
|
|
146 |
mStates = new ScrambleState[] // built so that all 3 axes must be present in every 4 consecutive moves |
|
147 | 147 |
{ |
148 |
new ScrambleStateGraph( new int[][] { m[ 1], m[ 2], m[ 3] } ), // 0
|
|
149 |
new ScrambleStateGraph( new int[][] { null, m[ 4], m[ 5] } ), // x
|
|
150 |
new ScrambleStateGraph( new int[][] { m[ 6], null, m[ 7] } ), // y
|
|
151 |
new ScrambleStateGraph( new int[][] { m[ 8], m[ 8], null } ), // z
|
|
152 |
new ScrambleStateGraph( new int[][] { m[10], null, m[ 7] } ), // xy
|
|
153 |
new ScrambleStateGraph( new int[][] { m[11], m[ 9], null } ), // xz
|
|
154 |
new ScrambleStateGraph( new int[][] { null, m[12], m[ 5] } ), // yx
|
|
155 |
new ScrambleStateGraph( new int[][] { m[ 8], m[13], null } ), // yz
|
|
156 |
new ScrambleStateGraph( new int[][] { null, m[ 4], m[14] } ), // zx
|
|
157 |
new ScrambleStateGraph( new int[][] { m[ 6], null, m[15] } ), // zy
|
|
158 |
new ScrambleStateGraph( new int[][] { null, null, m[ 5] } ), // xyx
|
|
159 |
new ScrambleStateGraph( new int[][] { null, m[ 4], null } ), // xzx
|
|
160 |
new ScrambleStateGraph( new int[][] { null, null, m[ 7] } ), // yxy
|
|
161 |
new ScrambleStateGraph( new int[][] { m[ 6], null, null } ), // yzy
|
|
162 |
new ScrambleStateGraph( new int[][] { null, m[ 9], null } ), // zxz
|
|
163 |
new ScrambleStateGraph( new int[][] { m[ 8], null, null } ), // zyz
|
|
148 |
new ScrambleState( new int[][] { m[ 1], m[ 2], m[ 3] } ), // 0 |
|
149 |
new ScrambleState( new int[][] { null, m[ 4], m[ 5] } ), // x |
|
150 |
new ScrambleState( new int[][] { m[ 6], null, m[ 7] } ), // y |
|
151 |
new ScrambleState( new int[][] { m[ 8], m[ 8], null } ), // z |
|
152 |
new ScrambleState( new int[][] { m[10], null, m[ 7] } ), // xy |
|
153 |
new ScrambleState( new int[][] { m[11], m[ 9], null } ), // xz |
|
154 |
new ScrambleState( new int[][] { null, m[12], m[ 5] } ), // yx |
|
155 |
new ScrambleState( new int[][] { m[ 8], m[13], null } ), // yz |
|
156 |
new ScrambleState( new int[][] { null, m[ 4], m[14] } ), // zx |
|
157 |
new ScrambleState( new int[][] { m[ 6], null, m[15] } ), // zy |
|
158 |
new ScrambleState( new int[][] { null, null, m[ 5] } ), // xyx |
|
159 |
new ScrambleState( new int[][] { null, m[ 4], null } ), // xzx |
|
160 |
new ScrambleState( new int[][] { null, null, m[ 7] } ), // yxy |
|
161 |
new ScrambleState( new int[][] { m[ 6], null, null } ), // yzy |
|
162 |
new ScrambleState( new int[][] { null, m[ 9], null } ), // zxz |
|
163 |
new ScrambleState( new int[][] { m[ 8], null, null } ), // zyz |
|
164 | 164 |
}; |
165 | 165 |
} |
166 | 166 |
|
Also available in: Unified diff
Introduce pseudorandom balancing into scrambling in case of the two Dinos (from now on, the more times a particular (ax,layer) combination has been chosen already in the scrambling sequence, the less likely it is to be chosen next).
Fix Dino6 - isSolved(). Sadly, it cannot be the geeneric function - it needs to be another special case.