66 |
66 |
|
67 |
67 |
private void fillRet(int[] table, int index, int count, int startMove, int graphVertex)
|
68 |
68 |
{
|
69 |
|
int num = count/2;
|
70 |
|
int move= startMove*num;
|
71 |
|
|
72 |
|
for(int i=0; i<num; i++)
|
|
69 |
for(int i=0; i<count; i++)
|
73 |
70 |
{
|
74 |
|
table[index+2*i ] = move++;
|
|
71 |
table[index+2*i ] = startMove++;
|
75 |
72 |
table[index+2*i+1] = graphVertex;
|
76 |
73 |
}
|
77 |
74 |
}
|
... | ... | |
85 |
82 |
int num = 8*layers;
|
86 |
83 |
int size = 0;
|
87 |
84 |
|
|
85 |
int count = 4*layers;
|
|
86 |
int offset1 = 4*layers + (numLayers%2==1 ? 4:0); // omit the middle layer, if it exists.
|
|
87 |
int offset2 = 4*layers;
|
|
88 |
|
88 |
89 |
if( x0 >=0 ) size += num;
|
89 |
90 |
if( x1 >=0 ) size += num;
|
90 |
91 |
if( x2 >=0 ) size += num;
|
... | ... | |
100 |
101 |
|
101 |
102 |
int[] ret = new int[size];
|
102 |
103 |
int index = 0;
|
103 |
|
|
104 |
|
if( x0 >=0 ) { fillRet(ret,index,num,0 ,x0 ); index+=num; }
|
105 |
|
if( x1 >=0 ) { fillRet(ret,index,num,1 ,x1 ); index+=num; }
|
106 |
|
if( x2 >=0 ) { fillRet(ret,index,num,2 ,x2 ); index+=num; }
|
107 |
|
if( x3 >=0 ) { fillRet(ret,index,num,3 ,x3 ); index+=num; }
|
108 |
|
if( x4 >=0 ) { fillRet(ret,index,num,4 ,x4 ); index+=num; }
|
109 |
|
if( x5 >=0 ) { fillRet(ret,index,num,5 ,x5 ); index+=num; }
|
110 |
|
if( x6 >=0 ) { fillRet(ret,index,num,6 ,x6 ); index+=num; }
|
111 |
|
if( x7 >=0 ) { fillRet(ret,index,num,7 ,x7 ); index+=num; }
|
112 |
|
if( x8 >=0 ) { fillRet(ret,index,num,8 ,x8 ); index+=num; }
|
113 |
|
if( x9 >=0 ) { fillRet(ret,index,num,9 ,x9 ); index+=num; }
|
114 |
|
if( x10>=0 ) { fillRet(ret,index,num,10,x10); index+=num; }
|
115 |
|
if( x11>=0 ) { fillRet(ret,index,num,11,x11); }
|
|
104 |
int startMove = 0;
|
|
105 |
|
|
106 |
if( x0 >=0 ) { fillRet(ret,index,count,startMove ,x0 ); index+=num; }
|
|
107 |
startMove += offset1;
|
|
108 |
if( x1 >=0 ) { fillRet(ret,index,count,startMove ,x1 ); index+=num; }
|
|
109 |
startMove += offset2;
|
|
110 |
if( x2 >=0 ) { fillRet(ret,index,count,startMove ,x2 ); index+=num; }
|
|
111 |
startMove += offset1;
|
|
112 |
if( x3 >=0 ) { fillRet(ret,index,count,startMove ,x3 ); index+=num; }
|
|
113 |
startMove += offset2;
|
|
114 |
if( x4 >=0 ) { fillRet(ret,index,count,startMove ,x4 ); index+=num; }
|
|
115 |
startMove += offset1;
|
|
116 |
if( x5 >=0 ) { fillRet(ret,index,count,startMove ,x5 ); index+=num; }
|
|
117 |
startMove += offset2;
|
|
118 |
if( x6 >=0 ) { fillRet(ret,index,count,startMove ,x6 ); index+=num; }
|
|
119 |
startMove += offset1;
|
|
120 |
if( x7 >=0 ) { fillRet(ret,index,count,startMove ,x7 ); index+=num; }
|
|
121 |
startMove += offset2;
|
|
122 |
if( x8 >=0 ) { fillRet(ret,index,count,startMove ,x8 ); index+=num; }
|
|
123 |
startMove += offset1;
|
|
124 |
if( x9 >=0 ) { fillRet(ret,index,count,startMove ,x9 ); index+=num; }
|
|
125 |
startMove += offset2;
|
|
126 |
if( x10>=0 ) { fillRet(ret,index,count,startMove ,x10); index+=num; }
|
|
127 |
startMove += offset1;
|
|
128 |
if( x11>=0 ) { fillRet(ret,index,count,startMove ,x11); }
|
116 |
129 |
|
117 |
130 |
return ret;
|
118 |
131 |
}
|
Correct scramble tables for Starminx, P. Crystal, Kilominx, Megaminx, Master Kilominx & Gigaminx.