cubing 0.63.2 → 0.63.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/chunks/{chunk-52ODPET6.js → chunk-OI3YIXMQ.js} +2 -2
- package/dist/bin/order.js +1 -1
- package/dist/bin/puzzle-geometry-bin.js +1 -1
- package/dist/bin/scramble.js +1 -1
- package/dist/lib/cubing/{PuzzleLoader-R-puDLmC.d.ts → PuzzleLoader-Bp8zngUn.d.ts} +10 -0
- package/dist/lib/cubing/alg/index.d.ts +2 -2
- package/dist/lib/cubing/bluetooth/index.d.ts +2 -2
- package/dist/lib/cubing/chunks/chunk-44CFF24P.js +239 -0
- package/dist/lib/cubing/chunks/chunk-44CFF24P.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-DQGYYYHZ.js +1180 -0
- package/dist/lib/cubing/chunks/chunk-DQGYYYHZ.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-FTE3QI5X.js +1074 -0
- package/dist/lib/cubing/chunks/chunk-FTE3QI5X.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-FZBKZ5ZB.js +265 -0
- package/dist/lib/cubing/chunks/chunk-FZBKZ5ZB.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-OUM32GEA.js +239 -0
- package/dist/lib/cubing/chunks/chunk-OUM32GEA.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-SGJ5WPE4.js +1074 -0
- package/dist/lib/cubing/chunks/chunk-SGJ5WPE4.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-TAVR35KU.js +265 -0
- package/dist/lib/cubing/chunks/chunk-TAVR35KU.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-VRTKWZPL.js +10084 -0
- package/dist/lib/cubing/chunks/chunk-VRTKWZPL.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-VSMFYTG6.js +10086 -0
- package/dist/lib/cubing/chunks/chunk-VSMFYTG6.js.map +7 -0
- package/dist/lib/cubing/chunks/inside-IHWQVDVU.js +564 -0
- package/dist/lib/cubing/chunks/inside-IHWQVDVU.js.map +7 -0
- package/dist/lib/cubing/chunks/inside-L2JI2BEY.js +564 -0
- package/dist/lib/cubing/chunks/inside-L2JI2BEY.js.map +7 -0
- package/dist/lib/cubing/chunks/search-dynamic-sgs-side-events-MXHP7O4R.js +1890 -0
- package/dist/lib/cubing/chunks/search-dynamic-sgs-side-events-MXHP7O4R.js.map +7 -0
- package/dist/lib/cubing/chunks/search-dynamic-sgs-side-events-XFECDWOF.js +1890 -0
- package/dist/lib/cubing/chunks/search-dynamic-sgs-side-events-XFECDWOF.js.map +7 -0
- package/dist/lib/cubing/chunks/search-dynamic-sgs-unofficial-CM33KT7L.js +1267 -0
- package/dist/lib/cubing/chunks/search-dynamic-sgs-unofficial-CM33KT7L.js.map +7 -0
- package/dist/lib/cubing/chunks/search-dynamic-sgs-unofficial-Q4LLHL2O.js +1267 -0
- package/dist/lib/cubing/chunks/search-dynamic-sgs-unofficial-Q4LLHL2O.js.map +7 -0
- package/dist/lib/cubing/chunks/search-dynamic-solve-4x4x4-COSEVJBV.js +2922 -0
- package/dist/lib/cubing/chunks/search-dynamic-solve-4x4x4-COSEVJBV.js.map +7 -0
- package/dist/lib/cubing/chunks/search-dynamic-solve-4x4x4-NANDMURR.js +2922 -0
- package/dist/lib/cubing/chunks/search-dynamic-solve-4x4x4-NANDMURR.js.map +7 -0
- package/dist/lib/cubing/chunks/twisty-dynamic-3d-5NZRNZ7C.js +1881 -0
- package/dist/lib/cubing/chunks/twisty-dynamic-3d-5NZRNZ7C.js.map +7 -0
- package/dist/lib/cubing/chunks/twisty-dynamic-3d-VGZIQ64W.js +1927 -0
- package/dist/lib/cubing/chunks/twisty-dynamic-3d-VGZIQ64W.js.map +7 -0
- package/dist/lib/cubing/chunks/twisty-dynamic-3d-XLUOPCLN.js +1881 -0
- package/dist/lib/cubing/chunks/twisty-dynamic-3d-XLUOPCLN.js.map +7 -0
- package/dist/lib/cubing/{events-IfSwQLYm.d.ts → events-CewDA1aS.d.ts} +1 -1
- package/dist/lib/cubing/{index-btIxbuNp.d.ts → index-DabjED-w.d.ts} +1 -1
- package/dist/lib/cubing/kpuzzle/index.d.ts +1 -1
- package/dist/lib/cubing/notation/index.d.ts +1 -1
- package/dist/lib/cubing/protocol/index.d.ts +1 -1
- package/dist/lib/cubing/puzzle-geometry/index.d.ts +2 -2
- package/dist/lib/cubing/puzzles/index.d.ts +1 -1
- package/dist/lib/cubing/scramble/index.d.ts +2 -2
- package/dist/lib/cubing/search/index.d.ts +3 -3
- package/dist/lib/cubing/stream/index.d.ts +3 -3
- package/dist/lib/cubing/twisty/index.d.ts +2 -2
- package/dist/lib/cubing/twisty/index.js +37 -4
- package/dist/lib/cubing/twisty/index.js.map +3 -3
- package/package.json +1 -1
- /package/dist/bin/chunks/{chunk-52ODPET6.js.map → chunk-OI3YIXMQ.js.map} +0 -0
|
@@ -0,0 +1,2922 @@
|
|
|
1
|
+
import "./chunk-NAPITA3L.js";
|
|
2
|
+
import "./chunk-44CFF24P.js";
|
|
3
|
+
import {
|
|
4
|
+
random333Scramble
|
|
5
|
+
} from "./chunk-FTE3QI5X.js";
|
|
6
|
+
import "./chunk-7GUL3OBQ.js";
|
|
7
|
+
import "./chunk-VSMFYTG6.js";
|
|
8
|
+
import "./chunk-RINY3U6G.js";
|
|
9
|
+
import {
|
|
10
|
+
Alg
|
|
11
|
+
} from "./chunk-O6HEZXGY.js";
|
|
12
|
+
|
|
13
|
+
// src/cubing/vendor/mit/cs0x7f/cstimer/src/js/lib/mathlib.ts
|
|
14
|
+
var Cnk = [];
|
|
15
|
+
var fact = [1];
|
|
16
|
+
for (let i = 0; i < 32; ++i) {
|
|
17
|
+
Cnk[i] = [];
|
|
18
|
+
for (let j = 0; j < 32; ++j) {
|
|
19
|
+
Cnk[i][j] = 0;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
for (let i = 0; i < 32; ++i) {
|
|
23
|
+
Cnk[i][0] = Cnk[i][i] = 1;
|
|
24
|
+
fact[i + 1] = fact[i] * (i + 1);
|
|
25
|
+
for (let j = 1; j < i; ++j) {
|
|
26
|
+
Cnk[i][j] = Cnk[i - 1][j - 1] + Cnk[i - 1][j];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function circle(arr, ...moreArgs) {
|
|
30
|
+
const length = moreArgs.length;
|
|
31
|
+
const temp = arr[moreArgs[length - 1]];
|
|
32
|
+
for (let i = length; i > 0; i--) {
|
|
33
|
+
arr[moreArgs[i]] = arr[moreArgs[i - 1]];
|
|
34
|
+
}
|
|
35
|
+
arr[moreArgs[0]] = temp;
|
|
36
|
+
return circle;
|
|
37
|
+
}
|
|
38
|
+
function set8Perm(arr, idx, n, even) {
|
|
39
|
+
n = (n || 8) - 1;
|
|
40
|
+
let val = 1985229328;
|
|
41
|
+
let prt = 0;
|
|
42
|
+
even ??= 0;
|
|
43
|
+
if (even < 0) {
|
|
44
|
+
idx <<= 1;
|
|
45
|
+
}
|
|
46
|
+
for (let i = 0; i < n; ++i) {
|
|
47
|
+
const p = fact[n - i];
|
|
48
|
+
let v = ~~(idx / p);
|
|
49
|
+
prt ^= v;
|
|
50
|
+
idx %= p;
|
|
51
|
+
v <<= 2;
|
|
52
|
+
arr[i] = val >> v & 7;
|
|
53
|
+
const m = (1 << v) - 1;
|
|
54
|
+
val = (val & m) + (val >> 4 & ~m);
|
|
55
|
+
}
|
|
56
|
+
if (even < 0 && (prt & 1) !== 0) {
|
|
57
|
+
arr[n] = arr[n - 1];
|
|
58
|
+
arr[n - 1] = val & 7;
|
|
59
|
+
} else {
|
|
60
|
+
arr[n] = val & 7;
|
|
61
|
+
}
|
|
62
|
+
return arr;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// src/cubing/vendor/mit/cs0x7f/cstimer/src/js/scramble/444-solver.ts
|
|
66
|
+
import { randomUIntBelow } from "random-uint-below";
|
|
67
|
+
function createArray(length1, length2) {
|
|
68
|
+
const result = new Array(length1);
|
|
69
|
+
if (length2 !== void 0) {
|
|
70
|
+
for (let i = 0; i < length1; i++) {
|
|
71
|
+
result[i] = new Array(length2);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return result;
|
|
75
|
+
}
|
|
76
|
+
var _;
|
|
77
|
+
var seedTable = {};
|
|
78
|
+
var CM$ = {};
|
|
79
|
+
var Q$Object = 0;
|
|
80
|
+
var Q$Serializable = 30;
|
|
81
|
+
var Q$Center1 = 21;
|
|
82
|
+
var Q$CornerCube = 22;
|
|
83
|
+
var Q$Edge3 = 23;
|
|
84
|
+
var Q$FullCube_0 = 24;
|
|
85
|
+
var Q$FullCube_$1 = 25;
|
|
86
|
+
var Q$Comparable = 34;
|
|
87
|
+
var Q$Search_0 = 26;
|
|
88
|
+
var Q$Object_$1 = 40;
|
|
89
|
+
function newSeed(id) {
|
|
90
|
+
return new seedTable[id]();
|
|
91
|
+
}
|
|
92
|
+
function defineSeed(id, superSeed, castableTypeMap, ...moreArgs) {
|
|
93
|
+
let seed = seedTable[id];
|
|
94
|
+
if (seed && !seed.___clazz$) {
|
|
95
|
+
_ = seed.prototype;
|
|
96
|
+
} else {
|
|
97
|
+
!seed && (seed = seedTable[id] = function() {
|
|
98
|
+
});
|
|
99
|
+
_ = seed.prototype = superSeed < 0 ? {} : newSeed(superSeed);
|
|
100
|
+
_.castableTypeMap$ = castableTypeMap;
|
|
101
|
+
}
|
|
102
|
+
for (const arg of moreArgs) {
|
|
103
|
+
arg.prototype = _;
|
|
104
|
+
}
|
|
105
|
+
if (seed.___clazz$) {
|
|
106
|
+
_.___clazz$ = seed.___clazz$;
|
|
107
|
+
seed.___clazz$ = null;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function makeCastMap(a) {
|
|
111
|
+
const result = {};
|
|
112
|
+
for (let i_0 = 0, c = a.length; i_0 < c; ++i_0) {
|
|
113
|
+
result[a[i_0]] = 1;
|
|
114
|
+
}
|
|
115
|
+
return result;
|
|
116
|
+
}
|
|
117
|
+
defineSeed(1, -1, CM$);
|
|
118
|
+
_.value = null;
|
|
119
|
+
function Array_0() {
|
|
120
|
+
}
|
|
121
|
+
function createFrom(a, length_0) {
|
|
122
|
+
const result = createFromSeed(0, length_0);
|
|
123
|
+
initValues(a.___clazz$, a.castableTypeMap$, a.queryId$, result);
|
|
124
|
+
return result;
|
|
125
|
+
}
|
|
126
|
+
function createFromSeed(seedType, length_0) {
|
|
127
|
+
const array = new Array(length_0);
|
|
128
|
+
if (seedType === 3) {
|
|
129
|
+
for (let i_0 = 0; i_0 < length_0; ++i_0) {
|
|
130
|
+
const value = {
|
|
131
|
+
m: 0,
|
|
132
|
+
l: 0,
|
|
133
|
+
h: 0
|
|
134
|
+
};
|
|
135
|
+
value.l = value.m = value.h = 0;
|
|
136
|
+
array[i_0] = value;
|
|
137
|
+
}
|
|
138
|
+
} else if (seedType > 0) {
|
|
139
|
+
const value = [null, 0, false][seedType];
|
|
140
|
+
for (let i_0 = 0; i_0 < length_0; ++i_0) {
|
|
141
|
+
array[i_0] = value;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return array;
|
|
145
|
+
}
|
|
146
|
+
function initDim(arrayClass, castableTypeMap, queryId, length_0, seedType) {
|
|
147
|
+
const result = createFromSeed(seedType, length_0);
|
|
148
|
+
initValues(arrayClass, castableTypeMap, queryId, result);
|
|
149
|
+
return result;
|
|
150
|
+
}
|
|
151
|
+
function initValues(arrayClass, castableTypeMap, queryId, array) {
|
|
152
|
+
$clinit_Array$ExpandoWrapper();
|
|
153
|
+
wrapArray(array, expandoNames_0, expandoValues_0);
|
|
154
|
+
array.___clazz$ = arrayClass;
|
|
155
|
+
array.castableTypeMap$ = castableTypeMap;
|
|
156
|
+
array.queryId$ = queryId;
|
|
157
|
+
return array;
|
|
158
|
+
}
|
|
159
|
+
function setCheck(array, index, value) {
|
|
160
|
+
return array[index] = value;
|
|
161
|
+
}
|
|
162
|
+
defineSeed(73, 1, {}, Array_0);
|
|
163
|
+
_.queryId$ = 0;
|
|
164
|
+
var ran$clinit_Array$ExpandoWrapper = false;
|
|
165
|
+
function $clinit_Array$ExpandoWrapper() {
|
|
166
|
+
if (ran$clinit_Array$ExpandoWrapper) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
ran$clinit_Array$ExpandoWrapper = true;
|
|
170
|
+
expandoNames_0 = [];
|
|
171
|
+
expandoValues_0 = [];
|
|
172
|
+
initExpandos(new Array_0(), expandoNames_0, expandoValues_0);
|
|
173
|
+
}
|
|
174
|
+
function initExpandos(protoType, expandoNames, expandoValues) {
|
|
175
|
+
let i_0 = 0;
|
|
176
|
+
let value;
|
|
177
|
+
for (const name_0 in protoType) {
|
|
178
|
+
if (value = protoType[name_0]) {
|
|
179
|
+
expandoNames[i_0] = name_0;
|
|
180
|
+
expandoValues[i_0] = value;
|
|
181
|
+
++i_0;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
function wrapArray(array, expandoNames, expandoValues) {
|
|
186
|
+
$clinit_Array$ExpandoWrapper();
|
|
187
|
+
for (let i_0 = 0, c = expandoNames.length; i_0 < c; ++i_0) {
|
|
188
|
+
array[expandoNames[i_0]] = expandoValues[i_0];
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
var expandoNames_0;
|
|
192
|
+
var expandoValues_0;
|
|
193
|
+
function canCast(src, dstId) {
|
|
194
|
+
return src.castableTypeMap$ && !!src.castableTypeMap$[dstId];
|
|
195
|
+
}
|
|
196
|
+
function instanceOf(src, dstId) {
|
|
197
|
+
return src !== null && canCast(src, dstId);
|
|
198
|
+
}
|
|
199
|
+
var ran$clinit_Center1 = false;
|
|
200
|
+
function $clinit_Center1() {
|
|
201
|
+
if (ran$clinit_Center1) {
|
|
202
|
+
return false;
|
|
203
|
+
}
|
|
204
|
+
ran$clinit_Center1 = true;
|
|
205
|
+
ctsmv = createArray(15582, 36);
|
|
206
|
+
sym2raw = createArray(15582);
|
|
207
|
+
csprun = createArray(15582);
|
|
208
|
+
symmult = createArray(48, 48);
|
|
209
|
+
symmove = createArray(48, 36);
|
|
210
|
+
syminv = createArray(48);
|
|
211
|
+
finish_0 = createArray(48);
|
|
212
|
+
}
|
|
213
|
+
function $$init_1(this$static) {
|
|
214
|
+
this$static.ct = createArray(24);
|
|
215
|
+
}
|
|
216
|
+
function $equals(this$static, obj) {
|
|
217
|
+
let c;
|
|
218
|
+
let i_0;
|
|
219
|
+
if (instanceOf(obj, Q$Center1)) {
|
|
220
|
+
c = obj;
|
|
221
|
+
for (i_0 = 0; i_0 < 24; ++i_0) {
|
|
222
|
+
if (this$static.ct[i_0] !== c.ct[i_0]) {
|
|
223
|
+
return false;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
return true;
|
|
227
|
+
}
|
|
228
|
+
return false;
|
|
229
|
+
}
|
|
230
|
+
function $get_1(this$static) {
|
|
231
|
+
let i_0;
|
|
232
|
+
let idx;
|
|
233
|
+
let r;
|
|
234
|
+
idx = 0;
|
|
235
|
+
r = 8;
|
|
236
|
+
for (i_0 = 23; i_0 >= 0; --i_0) {
|
|
237
|
+
this$static.ct[i_0] === 1 && (idx += Cnk[i_0][r--]);
|
|
238
|
+
}
|
|
239
|
+
return idx;
|
|
240
|
+
}
|
|
241
|
+
function $getsym(this$static) {
|
|
242
|
+
let cord;
|
|
243
|
+
let j;
|
|
244
|
+
if (raw2sym !== null) {
|
|
245
|
+
return raw2sym[$get_1(this$static)];
|
|
246
|
+
}
|
|
247
|
+
for (j = 0; j < 48; ++j) {
|
|
248
|
+
cord = raw2sym_0($get_1(this$static));
|
|
249
|
+
if (cord !== -1) {
|
|
250
|
+
return cord * 64 + j;
|
|
251
|
+
}
|
|
252
|
+
$rot(this$static, 0);
|
|
253
|
+
j % 2 === 1 && $rot(this$static, 1);
|
|
254
|
+
j % 8 === 7 && $rot(this$static, 2);
|
|
255
|
+
j % 16 === 15 && $rot(this$static, 3);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
function $move(this$static, m_0) {
|
|
259
|
+
const key = m_0 % 3;
|
|
260
|
+
m_0 = ~~(m_0 / 3);
|
|
261
|
+
switch (m_0) {
|
|
262
|
+
case 0: {
|
|
263
|
+
swap(this$static.ct, 0, 1, 2, 3, key);
|
|
264
|
+
break;
|
|
265
|
+
}
|
|
266
|
+
case 1: {
|
|
267
|
+
swap(this$static.ct, 16, 17, 18, 19, key);
|
|
268
|
+
break;
|
|
269
|
+
}
|
|
270
|
+
case 2: {
|
|
271
|
+
swap(this$static.ct, 8, 9, 10, 11, key);
|
|
272
|
+
break;
|
|
273
|
+
}
|
|
274
|
+
case 3: {
|
|
275
|
+
swap(this$static.ct, 4, 5, 6, 7, key);
|
|
276
|
+
break;
|
|
277
|
+
}
|
|
278
|
+
case 4: {
|
|
279
|
+
swap(this$static.ct, 20, 21, 22, 23, key);
|
|
280
|
+
break;
|
|
281
|
+
}
|
|
282
|
+
case 5: {
|
|
283
|
+
swap(this$static.ct, 12, 13, 14, 15, key);
|
|
284
|
+
break;
|
|
285
|
+
}
|
|
286
|
+
case 6: {
|
|
287
|
+
swap(this$static.ct, 0, 1, 2, 3, key);
|
|
288
|
+
swap(this$static.ct, 8, 20, 12, 16, key);
|
|
289
|
+
swap(this$static.ct, 9, 21, 13, 17, key);
|
|
290
|
+
break;
|
|
291
|
+
}
|
|
292
|
+
case 7: {
|
|
293
|
+
swap(this$static.ct, 16, 17, 18, 19, key);
|
|
294
|
+
swap(this$static.ct, 1, 15, 5, 9, key);
|
|
295
|
+
swap(this$static.ct, 2, 12, 6, 10, key);
|
|
296
|
+
break;
|
|
297
|
+
}
|
|
298
|
+
case 8: {
|
|
299
|
+
swap(this$static.ct, 8, 9, 10, 11, key);
|
|
300
|
+
swap(this$static.ct, 2, 19, 4, 21, key);
|
|
301
|
+
swap(this$static.ct, 3, 16, 5, 22, key);
|
|
302
|
+
break;
|
|
303
|
+
}
|
|
304
|
+
case 9: {
|
|
305
|
+
swap(this$static.ct, 4, 5, 6, 7, key);
|
|
306
|
+
swap(this$static.ct, 10, 18, 14, 22, key);
|
|
307
|
+
swap(this$static.ct, 11, 19, 15, 23, key);
|
|
308
|
+
break;
|
|
309
|
+
}
|
|
310
|
+
case 10: {
|
|
311
|
+
swap(this$static.ct, 20, 21, 22, 23, key);
|
|
312
|
+
swap(this$static.ct, 0, 8, 4, 14, key);
|
|
313
|
+
swap(this$static.ct, 3, 11, 7, 13, key);
|
|
314
|
+
break;
|
|
315
|
+
}
|
|
316
|
+
case 11: {
|
|
317
|
+
swap(this$static.ct, 12, 13, 14, 15, key);
|
|
318
|
+
swap(this$static.ct, 1, 20, 7, 18, key);
|
|
319
|
+
swap(this$static.ct, 0, 23, 6, 17, key);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
function $rot(this$static, r) {
|
|
324
|
+
switch (r) {
|
|
325
|
+
case 0: {
|
|
326
|
+
$move(this$static, 19);
|
|
327
|
+
$move(this$static, 28);
|
|
328
|
+
break;
|
|
329
|
+
}
|
|
330
|
+
case 1: {
|
|
331
|
+
$move(this$static, 21);
|
|
332
|
+
$move(this$static, 32);
|
|
333
|
+
break;
|
|
334
|
+
}
|
|
335
|
+
case 2: {
|
|
336
|
+
swap(this$static.ct, 0, 3, 1, 2, 1);
|
|
337
|
+
swap(this$static.ct, 8, 11, 9, 10, 1);
|
|
338
|
+
swap(this$static.ct, 4, 7, 5, 6, 1);
|
|
339
|
+
swap(this$static.ct, 12, 15, 13, 14, 1);
|
|
340
|
+
swap(this$static.ct, 16, 19, 21, 22, 1);
|
|
341
|
+
swap(this$static.ct, 17, 18, 20, 23, 1);
|
|
342
|
+
break;
|
|
343
|
+
}
|
|
344
|
+
case 3: {
|
|
345
|
+
$move(this$static, 18);
|
|
346
|
+
$move(this$static, 29);
|
|
347
|
+
$move(this$static, 24);
|
|
348
|
+
$move(this$static, 35);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
function $rotate(this$static, r) {
|
|
353
|
+
let j;
|
|
354
|
+
for (j = 0; j < r; ++j) {
|
|
355
|
+
$rot(this$static, 0);
|
|
356
|
+
j % 2 === 1 && $rot(this$static, 1);
|
|
357
|
+
j % 8 === 7 && $rot(this$static, 2);
|
|
358
|
+
j % 16 === 15 && $rot(this$static, 3);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
function $set_0(this$static, idx) {
|
|
362
|
+
let i_0;
|
|
363
|
+
let r;
|
|
364
|
+
r = 8;
|
|
365
|
+
for (i_0 = 23; i_0 >= 0; --i_0) {
|
|
366
|
+
this$static.ct[i_0] = 0;
|
|
367
|
+
if (idx >= Cnk[i_0][r]) {
|
|
368
|
+
idx -= Cnk[i_0][r--];
|
|
369
|
+
this$static.ct[i_0] = 1;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
function $set_1(this$static, c) {
|
|
374
|
+
let i_0;
|
|
375
|
+
for (i_0 = 0; i_0 < 24; ++i_0) {
|
|
376
|
+
this$static.ct[i_0] = c.ct[i_0];
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
function Center1_0() {
|
|
380
|
+
let i_0;
|
|
381
|
+
$$init_1(this);
|
|
382
|
+
for (i_0 = 0; i_0 < 8; ++i_0) {
|
|
383
|
+
this.ct[i_0] = 1;
|
|
384
|
+
}
|
|
385
|
+
for (i_0 = 8; i_0 < 24; ++i_0) {
|
|
386
|
+
this.ct[i_0] = 0;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
function Center1_1(c, urf) {
|
|
390
|
+
let i_0;
|
|
391
|
+
$$init_1(this);
|
|
392
|
+
for (i_0 = 0; i_0 < 24; ++i_0) {
|
|
393
|
+
this.ct[i_0] = ~~(c.ct[i_0] / 2) === urf ? 1 : 0;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
function Center1_2(ct) {
|
|
397
|
+
let i_0;
|
|
398
|
+
$$init_1(this);
|
|
399
|
+
for (i_0 = 0; i_0 < 24; ++i_0) {
|
|
400
|
+
this.ct[i_0] = ct[i_0];
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
function createMoveTable() {
|
|
404
|
+
let i_0;
|
|
405
|
+
let m_0;
|
|
406
|
+
const c = new Center1_0();
|
|
407
|
+
const d = new Center1_0();
|
|
408
|
+
for (i_0 = 0; i_0 < 15582; ++i_0) {
|
|
409
|
+
$set_0(d, sym2raw[i_0]);
|
|
410
|
+
for (m_0 = 0; m_0 < 36; ++m_0) {
|
|
411
|
+
$set_1(c, d);
|
|
412
|
+
$move(c, m_0);
|
|
413
|
+
ctsmv[i_0][m_0] = $getsym(c);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
function createPrun() {
|
|
418
|
+
let check;
|
|
419
|
+
let depth;
|
|
420
|
+
let done;
|
|
421
|
+
let i_0;
|
|
422
|
+
let idx;
|
|
423
|
+
let inv;
|
|
424
|
+
let m_0;
|
|
425
|
+
let select;
|
|
426
|
+
fill_0(csprun);
|
|
427
|
+
csprun[0] = 0;
|
|
428
|
+
depth = 0;
|
|
429
|
+
done = 1;
|
|
430
|
+
while (done !== 15582) {
|
|
431
|
+
inv = depth > 4;
|
|
432
|
+
select = inv ? -1 : depth;
|
|
433
|
+
check = inv ? depth : -1;
|
|
434
|
+
++depth;
|
|
435
|
+
for (i_0 = 0; i_0 < 15582; ++i_0) {
|
|
436
|
+
if (csprun[i_0] !== select) {
|
|
437
|
+
continue;
|
|
438
|
+
}
|
|
439
|
+
for (m_0 = 0; m_0 < 27; ++m_0) {
|
|
440
|
+
idx = ~~ctsmv[i_0][m_0] >>> 6;
|
|
441
|
+
if (csprun[idx] !== check) {
|
|
442
|
+
continue;
|
|
443
|
+
}
|
|
444
|
+
++done;
|
|
445
|
+
if (inv) {
|
|
446
|
+
csprun[i_0] = depth;
|
|
447
|
+
break;
|
|
448
|
+
} else {
|
|
449
|
+
csprun[idx] = depth;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
function getSolvedSym(cube) {
|
|
456
|
+
let check;
|
|
457
|
+
let i_0;
|
|
458
|
+
let j;
|
|
459
|
+
const c = new Center1_2(cube.ct);
|
|
460
|
+
for (j = 0; j < 48; ++j) {
|
|
461
|
+
check = true;
|
|
462
|
+
for (i_0 = 0; i_0 < 24; ++i_0) {
|
|
463
|
+
if (c.ct[i_0] !== ~~(i_0 / 4)) {
|
|
464
|
+
check = false;
|
|
465
|
+
break;
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
if (check) {
|
|
469
|
+
return j;
|
|
470
|
+
}
|
|
471
|
+
$rot(c, 0);
|
|
472
|
+
j % 2 === 1 && $rot(c, 1);
|
|
473
|
+
j % 8 === 7 && $rot(c, 2);
|
|
474
|
+
j % 16 === 15 && $rot(c, 3);
|
|
475
|
+
}
|
|
476
|
+
return -1;
|
|
477
|
+
}
|
|
478
|
+
function initSym_0() {
|
|
479
|
+
let i_0;
|
|
480
|
+
let j;
|
|
481
|
+
let k_0;
|
|
482
|
+
const c = new Center1_0();
|
|
483
|
+
for (i_0 = 0; i_0 < 24; ++i_0) {
|
|
484
|
+
c.ct[i_0] = i_0;
|
|
485
|
+
}
|
|
486
|
+
const d = new Center1_2(c.ct);
|
|
487
|
+
const e = new Center1_2(c.ct);
|
|
488
|
+
const f = new Center1_2(c.ct);
|
|
489
|
+
for (i_0 = 0; i_0 < 48; ++i_0) {
|
|
490
|
+
for (j = 0; j < 48; ++j) {
|
|
491
|
+
for (k_0 = 0; k_0 < 48; ++k_0) {
|
|
492
|
+
if ($equals(c, d)) {
|
|
493
|
+
symmult[i_0][j] = k_0;
|
|
494
|
+
k_0 === 0 && (syminv[i_0] = j);
|
|
495
|
+
}
|
|
496
|
+
$rot(d, 0);
|
|
497
|
+
k_0 % 2 === 1 && $rot(d, 1);
|
|
498
|
+
k_0 % 8 === 7 && $rot(d, 2);
|
|
499
|
+
k_0 % 16 === 15 && $rot(d, 3);
|
|
500
|
+
}
|
|
501
|
+
$rot(c, 0);
|
|
502
|
+
j % 2 === 1 && $rot(c, 1);
|
|
503
|
+
j % 8 === 7 && $rot(c, 2);
|
|
504
|
+
j % 16 === 15 && $rot(c, 3);
|
|
505
|
+
}
|
|
506
|
+
$rot(c, 0);
|
|
507
|
+
i_0 % 2 === 1 && $rot(c, 1);
|
|
508
|
+
i_0 % 8 === 7 && $rot(c, 2);
|
|
509
|
+
i_0 % 16 === 15 && $rot(c, 3);
|
|
510
|
+
}
|
|
511
|
+
for (i_0 = 0; i_0 < 48; ++i_0) {
|
|
512
|
+
$set_1(c, e);
|
|
513
|
+
$rotate(c, syminv[i_0]);
|
|
514
|
+
for (j = 0; j < 36; ++j) {
|
|
515
|
+
$set_1(d, c);
|
|
516
|
+
$move(d, j);
|
|
517
|
+
$rotate(d, i_0);
|
|
518
|
+
for (k_0 = 0; k_0 < 36; ++k_0) {
|
|
519
|
+
$set_1(f, e);
|
|
520
|
+
$move(f, k_0);
|
|
521
|
+
if ($equals(f, d)) {
|
|
522
|
+
symmove[i_0][j] = k_0;
|
|
523
|
+
break;
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
$set_0(c, 0);
|
|
529
|
+
for (i_0 = 0; i_0 < 48; ++i_0) {
|
|
530
|
+
finish_0[syminv[i_0]] = $get_1(c);
|
|
531
|
+
$rot(c, 0);
|
|
532
|
+
i_0 % 2 === 1 && $rot(c, 1);
|
|
533
|
+
i_0 % 8 === 7 && $rot(c, 2);
|
|
534
|
+
i_0 % 16 === 15 && $rot(c, 3);
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
function initSym2Raw() {
|
|
538
|
+
let count;
|
|
539
|
+
let i_0;
|
|
540
|
+
let idx;
|
|
541
|
+
let j;
|
|
542
|
+
const c = new Center1_0();
|
|
543
|
+
const occ = createArray(22984);
|
|
544
|
+
for (i_0 = 0; i_0 < 22984; i_0++) {
|
|
545
|
+
occ[i_0] = 0;
|
|
546
|
+
}
|
|
547
|
+
count = 0;
|
|
548
|
+
for (i_0 = 0; i_0 < 735471; ++i_0) {
|
|
549
|
+
if ((occ[~~i_0 >>> 5] & 1 << (i_0 & 31)) === 0) {
|
|
550
|
+
$set_0(c, i_0);
|
|
551
|
+
for (j = 0; j < 48; ++j) {
|
|
552
|
+
idx = $get_1(c);
|
|
553
|
+
occ[~~idx >>> 5] |= 1 << (idx & 31);
|
|
554
|
+
raw2sym !== null && (raw2sym[idx] = count << 6 | syminv[j]);
|
|
555
|
+
$rot(c, 0);
|
|
556
|
+
j % 2 === 1 && $rot(c, 1);
|
|
557
|
+
j % 8 === 7 && $rot(c, 2);
|
|
558
|
+
j % 16 === 15 && $rot(c, 3);
|
|
559
|
+
}
|
|
560
|
+
sym2raw[count++] = i_0;
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
function raw2sym_0(n) {
|
|
565
|
+
const m_0 = binarySearch_0(sym2raw, n);
|
|
566
|
+
return m_0 >= 0 ? m_0 : -1;
|
|
567
|
+
}
|
|
568
|
+
defineSeed(153, 1, makeCastMap([Q$Center1]), Center1_0, Center1_1, Center1_2);
|
|
569
|
+
var csprun;
|
|
570
|
+
var ctsmv;
|
|
571
|
+
var finish_0;
|
|
572
|
+
var raw2sym = null;
|
|
573
|
+
var sym2raw;
|
|
574
|
+
var syminv;
|
|
575
|
+
var symmove;
|
|
576
|
+
var symmult;
|
|
577
|
+
var ran$clinit_Center2 = false;
|
|
578
|
+
function $clinit_Center2() {
|
|
579
|
+
if (ran$clinit_Center2) {
|
|
580
|
+
return;
|
|
581
|
+
}
|
|
582
|
+
ran$clinit_Center2 = true;
|
|
583
|
+
rlmv = createArray(70, 28);
|
|
584
|
+
ctmv = createArray(6435, 28);
|
|
585
|
+
rlrot = createArray(70, 16);
|
|
586
|
+
ctrot = createArray(6435, 16);
|
|
587
|
+
ctprun = createArray(450450);
|
|
588
|
+
pmv = [
|
|
589
|
+
0,
|
|
590
|
+
0,
|
|
591
|
+
0,
|
|
592
|
+
0,
|
|
593
|
+
0,
|
|
594
|
+
0,
|
|
595
|
+
0,
|
|
596
|
+
0,
|
|
597
|
+
0,
|
|
598
|
+
0,
|
|
599
|
+
0,
|
|
600
|
+
0,
|
|
601
|
+
0,
|
|
602
|
+
0,
|
|
603
|
+
0,
|
|
604
|
+
0,
|
|
605
|
+
0,
|
|
606
|
+
0,
|
|
607
|
+
0,
|
|
608
|
+
0,
|
|
609
|
+
0,
|
|
610
|
+
1,
|
|
611
|
+
0,
|
|
612
|
+
1,
|
|
613
|
+
0,
|
|
614
|
+
0,
|
|
615
|
+
0,
|
|
616
|
+
0,
|
|
617
|
+
0,
|
|
618
|
+
0,
|
|
619
|
+
1,
|
|
620
|
+
0,
|
|
621
|
+
1,
|
|
622
|
+
0,
|
|
623
|
+
0,
|
|
624
|
+
0
|
|
625
|
+
];
|
|
626
|
+
}
|
|
627
|
+
function $getct(this$static) {
|
|
628
|
+
let i_0;
|
|
629
|
+
let idx;
|
|
630
|
+
let r;
|
|
631
|
+
idx = 0;
|
|
632
|
+
r = 8;
|
|
633
|
+
for (i_0 = 14; i_0 >= 0; --i_0) {
|
|
634
|
+
this$static.ct[i_0] !== this$static.ct[15] && (idx += Cnk[i_0][r--]);
|
|
635
|
+
}
|
|
636
|
+
return idx;
|
|
637
|
+
}
|
|
638
|
+
function $getrl(this$static) {
|
|
639
|
+
let i_0;
|
|
640
|
+
let idx;
|
|
641
|
+
let r;
|
|
642
|
+
idx = 0;
|
|
643
|
+
r = 4;
|
|
644
|
+
for (i_0 = 6; i_0 >= 0; --i_0) {
|
|
645
|
+
this$static.rl[i_0] !== this$static.rl[7] && (idx += Cnk[i_0][r--]);
|
|
646
|
+
}
|
|
647
|
+
return idx * 2 + this$static.parity;
|
|
648
|
+
}
|
|
649
|
+
function $move_0(this$static, m_0) {
|
|
650
|
+
this$static.parity ^= pmv[m_0];
|
|
651
|
+
const key = m_0 % 3;
|
|
652
|
+
m_0 = ~~(m_0 / 3);
|
|
653
|
+
switch (m_0) {
|
|
654
|
+
case 0: {
|
|
655
|
+
swap(this$static.ct, 0, 1, 2, 3, key);
|
|
656
|
+
break;
|
|
657
|
+
}
|
|
658
|
+
case 1: {
|
|
659
|
+
swap(this$static.rl, 0, 1, 2, 3, key);
|
|
660
|
+
break;
|
|
661
|
+
}
|
|
662
|
+
case 2: {
|
|
663
|
+
swap(this$static.ct, 8, 9, 10, 11, key);
|
|
664
|
+
break;
|
|
665
|
+
}
|
|
666
|
+
case 3: {
|
|
667
|
+
swap(this$static.ct, 4, 5, 6, 7, key);
|
|
668
|
+
break;
|
|
669
|
+
}
|
|
670
|
+
case 4: {
|
|
671
|
+
swap(this$static.rl, 4, 5, 6, 7, key);
|
|
672
|
+
break;
|
|
673
|
+
}
|
|
674
|
+
case 5: {
|
|
675
|
+
swap(this$static.ct, 12, 13, 14, 15, key);
|
|
676
|
+
break;
|
|
677
|
+
}
|
|
678
|
+
case 6: {
|
|
679
|
+
swap(this$static.ct, 0, 1, 2, 3, key);
|
|
680
|
+
swap(this$static.rl, 0, 5, 4, 1, key);
|
|
681
|
+
swap(this$static.ct, 8, 9, 12, 13, key);
|
|
682
|
+
break;
|
|
683
|
+
}
|
|
684
|
+
case 7: {
|
|
685
|
+
swap(this$static.rl, 0, 1, 2, 3, key);
|
|
686
|
+
swap(this$static.ct, 1, 15, 5, 9, key);
|
|
687
|
+
swap(this$static.ct, 2, 12, 6, 10, key);
|
|
688
|
+
break;
|
|
689
|
+
}
|
|
690
|
+
case 8: {
|
|
691
|
+
swap(this$static.ct, 8, 9, 10, 11, key);
|
|
692
|
+
swap(this$static.rl, 0, 3, 6, 5, key);
|
|
693
|
+
swap(this$static.ct, 3, 2, 5, 4, key);
|
|
694
|
+
break;
|
|
695
|
+
}
|
|
696
|
+
case 9: {
|
|
697
|
+
swap(this$static.ct, 4, 5, 6, 7, key);
|
|
698
|
+
swap(this$static.rl, 3, 2, 7, 6, key);
|
|
699
|
+
swap(this$static.ct, 11, 10, 15, 14, key);
|
|
700
|
+
break;
|
|
701
|
+
}
|
|
702
|
+
case 10: {
|
|
703
|
+
swap(this$static.rl, 4, 5, 6, 7, key);
|
|
704
|
+
swap(this$static.ct, 0, 8, 4, 14, key);
|
|
705
|
+
swap(this$static.ct, 3, 11, 7, 13, key);
|
|
706
|
+
break;
|
|
707
|
+
}
|
|
708
|
+
case 11: {
|
|
709
|
+
swap(this$static.ct, 12, 13, 14, 15, key);
|
|
710
|
+
swap(this$static.rl, 1, 4, 7, 2, key);
|
|
711
|
+
swap(this$static.ct, 1, 0, 7, 6, key);
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
function $rot_0(this$static, r) {
|
|
716
|
+
switch (r) {
|
|
717
|
+
case 0: {
|
|
718
|
+
$move_0(this$static, 19);
|
|
719
|
+
$move_0(this$static, 28);
|
|
720
|
+
break;
|
|
721
|
+
}
|
|
722
|
+
case 1: {
|
|
723
|
+
$move_0(this$static, 21);
|
|
724
|
+
$move_0(this$static, 32);
|
|
725
|
+
break;
|
|
726
|
+
}
|
|
727
|
+
case 2: {
|
|
728
|
+
swap(this$static.ct, 0, 3, 1, 2, 1);
|
|
729
|
+
swap(this$static.ct, 8, 11, 9, 10, 1);
|
|
730
|
+
swap(this$static.ct, 4, 7, 5, 6, 1);
|
|
731
|
+
swap(this$static.ct, 12, 15, 13, 14, 1);
|
|
732
|
+
swap(this$static.rl, 0, 3, 5, 6, 1);
|
|
733
|
+
swap(this$static.rl, 1, 2, 4, 7, 1);
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
function $set_2(this$static, c, edgeParity) {
|
|
738
|
+
let i_0;
|
|
739
|
+
for (i_0 = 0; i_0 < 16; ++i_0) {
|
|
740
|
+
this$static.ct[i_0] = ~~(c.ct[i_0] / 2);
|
|
741
|
+
}
|
|
742
|
+
for (i_0 = 0; i_0 < 8; ++i_0) {
|
|
743
|
+
this$static.rl[i_0] = c.ct[i_0 + 16];
|
|
744
|
+
}
|
|
745
|
+
this$static.parity = edgeParity;
|
|
746
|
+
}
|
|
747
|
+
function $setct(this$static, idx) {
|
|
748
|
+
let i_0;
|
|
749
|
+
let r;
|
|
750
|
+
r = 8;
|
|
751
|
+
this$static.ct[15] = 0;
|
|
752
|
+
for (i_0 = 14; i_0 >= 0; --i_0) {
|
|
753
|
+
if (idx >= Cnk[i_0][r]) {
|
|
754
|
+
idx -= Cnk[i_0][r--];
|
|
755
|
+
this$static.ct[i_0] = 1;
|
|
756
|
+
} else {
|
|
757
|
+
this$static.ct[i_0] = 0;
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
function $setrl(this$static, idx) {
|
|
762
|
+
let i_0;
|
|
763
|
+
let r;
|
|
764
|
+
this$static.parity = idx & 1;
|
|
765
|
+
idx >>>= 1;
|
|
766
|
+
r = 4;
|
|
767
|
+
this$static.rl[7] = 0;
|
|
768
|
+
for (i_0 = 6; i_0 >= 0; --i_0) {
|
|
769
|
+
if (idx >= Cnk[i_0][r]) {
|
|
770
|
+
idx -= Cnk[i_0][r--];
|
|
771
|
+
this$static.rl[i_0] = 1;
|
|
772
|
+
} else {
|
|
773
|
+
this$static.rl[i_0] = 0;
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
function Center2_0() {
|
|
778
|
+
this.rl = createArray(8);
|
|
779
|
+
this.ct = createArray(16);
|
|
780
|
+
}
|
|
781
|
+
function init_3() {
|
|
782
|
+
let ct;
|
|
783
|
+
let ctx;
|
|
784
|
+
let depth;
|
|
785
|
+
let done;
|
|
786
|
+
let i_0;
|
|
787
|
+
let idx;
|
|
788
|
+
let j;
|
|
789
|
+
let m_0;
|
|
790
|
+
let rl;
|
|
791
|
+
let rlx;
|
|
792
|
+
const c = new Center2_0();
|
|
793
|
+
for (i_0 = 0; i_0 < 70; ++i_0) {
|
|
794
|
+
for (m_0 = 0; m_0 < 28; ++m_0) {
|
|
795
|
+
$setrl(c, i_0);
|
|
796
|
+
$move_0(c, move2std[m_0]);
|
|
797
|
+
rlmv[i_0][m_0] = $getrl(c);
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
for (i_0 = 0; i_0 < 70; ++i_0) {
|
|
801
|
+
$setrl(c, i_0);
|
|
802
|
+
for (j = 0; j < 16; ++j) {
|
|
803
|
+
rlrot[i_0][j] = $getrl(c);
|
|
804
|
+
$rot_0(c, 0);
|
|
805
|
+
j % 2 === 1 && $rot_0(c, 1);
|
|
806
|
+
j % 8 === 7 && $rot_0(c, 2);
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
for (i_0 = 0; i_0 < 6435; ++i_0) {
|
|
810
|
+
$setct(c, i_0);
|
|
811
|
+
for (j = 0; j < 16; ++j) {
|
|
812
|
+
ctrot[i_0][j] = $getct(c) & 65535;
|
|
813
|
+
$rot_0(c, 0);
|
|
814
|
+
j % 2 === 1 && $rot_0(c, 1);
|
|
815
|
+
j % 8 === 7 && $rot_0(c, 2);
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
for (i_0 = 0; i_0 < 6435; ++i_0) {
|
|
819
|
+
for (m_0 = 0; m_0 < 28; ++m_0) {
|
|
820
|
+
$setct(c, i_0);
|
|
821
|
+
$move_0(c, move2std[m_0]);
|
|
822
|
+
ctmv[i_0][m_0] = $getct(c) & 65535;
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
fill_0(ctprun);
|
|
826
|
+
ctprun[0] = ctprun[18] = ctprun[28] = ctprun[46] = ctprun[54] = ctprun[56] = 0;
|
|
827
|
+
depth = 0;
|
|
828
|
+
done = 6;
|
|
829
|
+
while (done !== 450450) {
|
|
830
|
+
const inv = depth > 6;
|
|
831
|
+
const select = inv ? -1 : depth;
|
|
832
|
+
const check = inv ? depth : -1;
|
|
833
|
+
++depth;
|
|
834
|
+
for (i_0 = 0; i_0 < 450450; ++i_0) {
|
|
835
|
+
if (ctprun[i_0] !== select) {
|
|
836
|
+
continue;
|
|
837
|
+
}
|
|
838
|
+
ct = ~~(i_0 / 70);
|
|
839
|
+
rl = i_0 % 70;
|
|
840
|
+
for (m_0 = 0; m_0 < 23; ++m_0) {
|
|
841
|
+
ctx = ctmv[ct][m_0];
|
|
842
|
+
rlx = rlmv[rl][m_0];
|
|
843
|
+
idx = ctx * 70 + rlx;
|
|
844
|
+
if (ctprun[idx] !== check) {
|
|
845
|
+
continue;
|
|
846
|
+
}
|
|
847
|
+
++done;
|
|
848
|
+
if (inv) {
|
|
849
|
+
ctprun[i_0] = depth;
|
|
850
|
+
break;
|
|
851
|
+
} else {
|
|
852
|
+
ctprun[idx] = depth;
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
defineSeed(154, 1, {}, Center2_0);
|
|
859
|
+
_.parity = 0;
|
|
860
|
+
var ctmv;
|
|
861
|
+
var ctprun;
|
|
862
|
+
var ctrot;
|
|
863
|
+
var pmv;
|
|
864
|
+
var rlmv;
|
|
865
|
+
var rlrot;
|
|
866
|
+
var ran$clinit_Center3 = false;
|
|
867
|
+
function $clinit_Center3() {
|
|
868
|
+
if (ran$clinit_Center3) {
|
|
869
|
+
return;
|
|
870
|
+
}
|
|
871
|
+
ran$clinit_Center3 = true;
|
|
872
|
+
ctmove = createArray(29400, 20);
|
|
873
|
+
pmove = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1];
|
|
874
|
+
prun_0 = createArray(29400);
|
|
875
|
+
rl2std = [0, 9, 14, 23, 27, 28, 41, 42, 46, 55, 60, 69];
|
|
876
|
+
std2rl = createArray(70);
|
|
877
|
+
}
|
|
878
|
+
function $getct_0(this$static) {
|
|
879
|
+
let i_0;
|
|
880
|
+
let idx;
|
|
881
|
+
let idxrl;
|
|
882
|
+
let r;
|
|
883
|
+
idx = 0;
|
|
884
|
+
r = 4;
|
|
885
|
+
for (i_0 = 6; i_0 >= 0; --i_0) {
|
|
886
|
+
this$static.ud[i_0] !== this$static.ud[7] && (idx += Cnk[i_0][r--]);
|
|
887
|
+
}
|
|
888
|
+
idx *= 35;
|
|
889
|
+
r = 4;
|
|
890
|
+
for (i_0 = 6; i_0 >= 0; --i_0) {
|
|
891
|
+
this$static.fb[i_0] !== this$static.fb[7] && (idx += Cnk[i_0][r--]);
|
|
892
|
+
}
|
|
893
|
+
idx *= 12;
|
|
894
|
+
const check = this$static.fb[7] ^ this$static.ud[7];
|
|
895
|
+
idxrl = 0;
|
|
896
|
+
r = 4;
|
|
897
|
+
for (i_0 = 7; i_0 >= 0; --i_0) {
|
|
898
|
+
this$static.rl[i_0] !== check && (idxrl += Cnk[i_0][r--]);
|
|
899
|
+
}
|
|
900
|
+
return this$static.parity + 2 * (idx + std2rl[idxrl]);
|
|
901
|
+
}
|
|
902
|
+
function $move_1(this$static, i_0) {
|
|
903
|
+
this$static.parity ^= pmove[i_0];
|
|
904
|
+
switch (i_0) {
|
|
905
|
+
case 0:
|
|
906
|
+
case 1:
|
|
907
|
+
case 2: {
|
|
908
|
+
swap(this$static.ud, 0, 1, 2, 3, i_0 % 3);
|
|
909
|
+
break;
|
|
910
|
+
}
|
|
911
|
+
case 3: {
|
|
912
|
+
swap(this$static.rl, 0, 1, 2, 3, 1);
|
|
913
|
+
break;
|
|
914
|
+
}
|
|
915
|
+
case 4:
|
|
916
|
+
case 5:
|
|
917
|
+
case 6: {
|
|
918
|
+
swap(this$static.fb, 0, 1, 2, 3, (i_0 - 1) % 3);
|
|
919
|
+
break;
|
|
920
|
+
}
|
|
921
|
+
case 7:
|
|
922
|
+
case 8:
|
|
923
|
+
case 9: {
|
|
924
|
+
swap(this$static.ud, 4, 5, 6, 7, (i_0 - 1) % 3);
|
|
925
|
+
break;
|
|
926
|
+
}
|
|
927
|
+
case 10: {
|
|
928
|
+
swap(this$static.rl, 4, 5, 6, 7, 1);
|
|
929
|
+
break;
|
|
930
|
+
}
|
|
931
|
+
case 11:
|
|
932
|
+
case 12:
|
|
933
|
+
case 13: {
|
|
934
|
+
swap(this$static.fb, 4, 5, 6, 7, (i_0 + 1) % 3);
|
|
935
|
+
break;
|
|
936
|
+
}
|
|
937
|
+
case 14: {
|
|
938
|
+
swap(this$static.ud, 0, 1, 2, 3, 1);
|
|
939
|
+
swap(this$static.rl, 0, 5, 4, 1, 1);
|
|
940
|
+
swap(this$static.fb, 0, 5, 4, 1, 1);
|
|
941
|
+
break;
|
|
942
|
+
}
|
|
943
|
+
case 15: {
|
|
944
|
+
swap(this$static.rl, 0, 1, 2, 3, 1);
|
|
945
|
+
swap(this$static.fb, 1, 4, 7, 2, 1);
|
|
946
|
+
swap(this$static.ud, 1, 6, 5, 2, 1);
|
|
947
|
+
break;
|
|
948
|
+
}
|
|
949
|
+
case 16: {
|
|
950
|
+
swap(this$static.fb, 0, 1, 2, 3, 1);
|
|
951
|
+
swap(this$static.ud, 3, 2, 5, 4, 1);
|
|
952
|
+
swap(this$static.rl, 0, 3, 6, 5, 1);
|
|
953
|
+
break;
|
|
954
|
+
}
|
|
955
|
+
case 17: {
|
|
956
|
+
swap(this$static.ud, 4, 5, 6, 7, 1);
|
|
957
|
+
swap(this$static.rl, 3, 2, 7, 6, 1);
|
|
958
|
+
swap(this$static.fb, 3, 2, 7, 6, 1);
|
|
959
|
+
break;
|
|
960
|
+
}
|
|
961
|
+
case 18: {
|
|
962
|
+
swap(this$static.rl, 4, 5, 6, 7, 1);
|
|
963
|
+
swap(this$static.fb, 0, 3, 6, 5, 1);
|
|
964
|
+
swap(this$static.ud, 0, 3, 4, 7, 1);
|
|
965
|
+
break;
|
|
966
|
+
}
|
|
967
|
+
case 19: {
|
|
968
|
+
swap(this$static.fb, 4, 5, 6, 7, 1);
|
|
969
|
+
swap(this$static.ud, 0, 7, 6, 1, 1);
|
|
970
|
+
swap(this$static.rl, 1, 4, 7, 2, 1);
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
function $set_3(this$static, c, eXc_parity) {
|
|
975
|
+
let i_0;
|
|
976
|
+
const parity = (c.ct[0] > c.ct[8] ? 1 : 0) ^ (c.ct[8] > c.ct[16] ? 1 : 0) ^ (c.ct[0] > c.ct[16] ? 1 : 0) ? 1 : 0;
|
|
977
|
+
for (i_0 = 0; i_0 < 8; ++i_0) {
|
|
978
|
+
this$static.ud[i_0] = c.ct[i_0] & 1 ^ 1;
|
|
979
|
+
this$static.fb[i_0] = c.ct[i_0 + 8] & 1 ^ 1;
|
|
980
|
+
this$static.rl[i_0] = c.ct[i_0 + 16] & 1 ^ 1 ^ parity;
|
|
981
|
+
}
|
|
982
|
+
this$static.parity = parity ^ eXc_parity;
|
|
983
|
+
}
|
|
984
|
+
function $setct_0(this$static, idx) {
|
|
985
|
+
let i_0;
|
|
986
|
+
let idxfb;
|
|
987
|
+
let idxrl;
|
|
988
|
+
let r;
|
|
989
|
+
this$static.parity = idx & 1;
|
|
990
|
+
idx >>>= 1;
|
|
991
|
+
idxrl = rl2std[idx % 12];
|
|
992
|
+
idx = ~~(idx / 12);
|
|
993
|
+
r = 4;
|
|
994
|
+
for (i_0 = 7; i_0 >= 0; --i_0) {
|
|
995
|
+
this$static.rl[i_0] = 0;
|
|
996
|
+
if (idxrl >= Cnk[i_0][r]) {
|
|
997
|
+
idxrl -= Cnk[i_0][r--];
|
|
998
|
+
this$static.rl[i_0] = 1;
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
idxfb = idx % 35;
|
|
1002
|
+
idx = ~~(idx / 35);
|
|
1003
|
+
r = 4;
|
|
1004
|
+
this$static.fb[7] = 0;
|
|
1005
|
+
for (i_0 = 6; i_0 >= 0; --i_0) {
|
|
1006
|
+
if (idxfb >= Cnk[i_0][r]) {
|
|
1007
|
+
idxfb -= Cnk[i_0][r--];
|
|
1008
|
+
this$static.fb[i_0] = 1;
|
|
1009
|
+
} else {
|
|
1010
|
+
this$static.fb[i_0] = 0;
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
r = 4;
|
|
1014
|
+
this$static.ud[7] = 0;
|
|
1015
|
+
for (i_0 = 6; i_0 >= 0; --i_0) {
|
|
1016
|
+
if (idx >= Cnk[i_0][r]) {
|
|
1017
|
+
idx -= Cnk[i_0][r--];
|
|
1018
|
+
this$static.ud[i_0] = 1;
|
|
1019
|
+
} else {
|
|
1020
|
+
this$static.ud[i_0] = 0;
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
function Center3_0() {
|
|
1025
|
+
this.ud = createArray(8);
|
|
1026
|
+
this.rl = createArray(8);
|
|
1027
|
+
this.fb = createArray(8);
|
|
1028
|
+
}
|
|
1029
|
+
function init_4() {
|
|
1030
|
+
let depth;
|
|
1031
|
+
let done;
|
|
1032
|
+
let i_0;
|
|
1033
|
+
let m_0;
|
|
1034
|
+
for (i_0 = 0; i_0 < 12; ++i_0) {
|
|
1035
|
+
std2rl[rl2std[i_0]] = i_0;
|
|
1036
|
+
}
|
|
1037
|
+
const c = new Center3_0();
|
|
1038
|
+
for (i_0 = 0; i_0 < 29400; ++i_0) {
|
|
1039
|
+
for (m_0 = 0; m_0 < 20; ++m_0) {
|
|
1040
|
+
$setct_0(c, i_0);
|
|
1041
|
+
$move_1(c, m_0);
|
|
1042
|
+
ctmove[i_0][m_0] = $getct_0(c) & 65535;
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
fill_0(prun_0);
|
|
1046
|
+
prun_0[0] = 0;
|
|
1047
|
+
depth = 0;
|
|
1048
|
+
done = 1;
|
|
1049
|
+
while (done !== 29400) {
|
|
1050
|
+
for (i_0 = 0; i_0 < 29400; ++i_0) {
|
|
1051
|
+
if (prun_0[i_0] !== depth) {
|
|
1052
|
+
continue;
|
|
1053
|
+
}
|
|
1054
|
+
for (m_0 = 0; m_0 < 17; ++m_0) {
|
|
1055
|
+
if (prun_0[ctmove[i_0][m_0]] === -1) {
|
|
1056
|
+
prun_0[ctmove[i_0][m_0]] = depth + 1;
|
|
1057
|
+
++done;
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
++depth;
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
defineSeed(155, 1, {}, Center3_0);
|
|
1065
|
+
_.parity = 0;
|
|
1066
|
+
var ctmove;
|
|
1067
|
+
var pmove;
|
|
1068
|
+
var prun_0;
|
|
1069
|
+
var rl2std;
|
|
1070
|
+
var std2rl;
|
|
1071
|
+
function $copy_1(this$static, c) {
|
|
1072
|
+
let i_0;
|
|
1073
|
+
for (i_0 = 0; i_0 < 24; ++i_0) {
|
|
1074
|
+
this$static.ct[i_0] = c.ct[i_0];
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
function $move_2(this$static, m_0) {
|
|
1078
|
+
const key = m_0 % 3;
|
|
1079
|
+
m_0 = ~~(m_0 / 3);
|
|
1080
|
+
switch (m_0) {
|
|
1081
|
+
case 0: {
|
|
1082
|
+
swap(this$static.ct, 0, 1, 2, 3, key);
|
|
1083
|
+
break;
|
|
1084
|
+
}
|
|
1085
|
+
case 1: {
|
|
1086
|
+
swap(this$static.ct, 16, 17, 18, 19, key);
|
|
1087
|
+
break;
|
|
1088
|
+
}
|
|
1089
|
+
case 2: {
|
|
1090
|
+
swap(this$static.ct, 8, 9, 10, 11, key);
|
|
1091
|
+
break;
|
|
1092
|
+
}
|
|
1093
|
+
case 3: {
|
|
1094
|
+
swap(this$static.ct, 4, 5, 6, 7, key);
|
|
1095
|
+
break;
|
|
1096
|
+
}
|
|
1097
|
+
case 4: {
|
|
1098
|
+
swap(this$static.ct, 20, 21, 22, 23, key);
|
|
1099
|
+
break;
|
|
1100
|
+
}
|
|
1101
|
+
case 5: {
|
|
1102
|
+
swap(this$static.ct, 12, 13, 14, 15, key);
|
|
1103
|
+
break;
|
|
1104
|
+
}
|
|
1105
|
+
case 6: {
|
|
1106
|
+
swap(this$static.ct, 0, 1, 2, 3, key);
|
|
1107
|
+
swap(this$static.ct, 8, 20, 12, 16, key);
|
|
1108
|
+
swap(this$static.ct, 9, 21, 13, 17, key);
|
|
1109
|
+
break;
|
|
1110
|
+
}
|
|
1111
|
+
case 7: {
|
|
1112
|
+
swap(this$static.ct, 16, 17, 18, 19, key);
|
|
1113
|
+
swap(this$static.ct, 1, 15, 5, 9, key);
|
|
1114
|
+
swap(this$static.ct, 2, 12, 6, 10, key);
|
|
1115
|
+
break;
|
|
1116
|
+
}
|
|
1117
|
+
case 8: {
|
|
1118
|
+
swap(this$static.ct, 8, 9, 10, 11, key);
|
|
1119
|
+
swap(this$static.ct, 2, 19, 4, 21, key);
|
|
1120
|
+
swap(this$static.ct, 3, 16, 5, 22, key);
|
|
1121
|
+
break;
|
|
1122
|
+
}
|
|
1123
|
+
case 9: {
|
|
1124
|
+
swap(this$static.ct, 4, 5, 6, 7, key);
|
|
1125
|
+
swap(this$static.ct, 10, 18, 14, 22, key);
|
|
1126
|
+
swap(this$static.ct, 11, 19, 15, 23, key);
|
|
1127
|
+
break;
|
|
1128
|
+
}
|
|
1129
|
+
case 10: {
|
|
1130
|
+
swap(this$static.ct, 20, 21, 22, 23, key);
|
|
1131
|
+
swap(this$static.ct, 0, 8, 4, 14, key);
|
|
1132
|
+
swap(this$static.ct, 3, 11, 7, 13, key);
|
|
1133
|
+
break;
|
|
1134
|
+
}
|
|
1135
|
+
case 11: {
|
|
1136
|
+
swap(this$static.ct, 12, 13, 14, 15, key);
|
|
1137
|
+
swap(this$static.ct, 1, 20, 7, 18, key);
|
|
1138
|
+
swap(this$static.ct, 0, 23, 6, 17, key);
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
function CenterCube_0() {
|
|
1143
|
+
let i_0;
|
|
1144
|
+
this.ct = createArray(24);
|
|
1145
|
+
for (i_0 = 0; i_0 < 24; ++i_0) {
|
|
1146
|
+
this.ct[i_0] = ~~(i_0 / 4);
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
function CenterCube_1() {
|
|
1150
|
+
let i_0;
|
|
1151
|
+
let m_0;
|
|
1152
|
+
let t;
|
|
1153
|
+
CenterCube_0.call(this);
|
|
1154
|
+
for (i_0 = 0; i_0 < 23; ++i_0) {
|
|
1155
|
+
t = i_0 + randomUIntBelow(24 - i_0);
|
|
1156
|
+
if (this.ct[t] !== this.ct[i_0]) {
|
|
1157
|
+
m_0 = this.ct[i_0];
|
|
1158
|
+
this.ct[i_0] = this.ct[t];
|
|
1159
|
+
this.ct[t] = m_0;
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
defineSeed(156, 1, {}, CenterCube_0, CenterCube_1);
|
|
1164
|
+
var ran$clinit_CornerCube = false;
|
|
1165
|
+
function $clinit_CornerCube() {
|
|
1166
|
+
if (ran$clinit_CornerCube) {
|
|
1167
|
+
return;
|
|
1168
|
+
}
|
|
1169
|
+
ran$clinit_CornerCube = true;
|
|
1170
|
+
moveCube_0 = createArray(18);
|
|
1171
|
+
initMove_0();
|
|
1172
|
+
}
|
|
1173
|
+
function $$init_2(this$static) {
|
|
1174
|
+
this$static.cp = [0, 1, 2, 3, 4, 5, 6, 7];
|
|
1175
|
+
this$static.co = [0, 0, 0, 0, 0, 0, 0, 0];
|
|
1176
|
+
}
|
|
1177
|
+
function $copy_2(this$static, c) {
|
|
1178
|
+
let i_0;
|
|
1179
|
+
for (i_0 = 0; i_0 < 8; ++i_0) {
|
|
1180
|
+
this$static.cp[i_0] = c.cp[i_0];
|
|
1181
|
+
this$static.co[i_0] = c.co[i_0];
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
function $move_3(this$static, idx) {
|
|
1185
|
+
!this$static.temps && (this$static.temps = new CornerCube_0());
|
|
1186
|
+
CornMult_0(this$static, moveCube_0[idx], this$static.temps);
|
|
1187
|
+
$copy_2(this$static, this$static.temps);
|
|
1188
|
+
}
|
|
1189
|
+
function $setTwist_0(this$static, idx) {
|
|
1190
|
+
let i_0;
|
|
1191
|
+
let twst;
|
|
1192
|
+
twst = 0;
|
|
1193
|
+
for (i_0 = 6; i_0 >= 0; --i_0) {
|
|
1194
|
+
twst += this$static.co[i_0] = idx % 3;
|
|
1195
|
+
idx = ~~(idx / 3);
|
|
1196
|
+
}
|
|
1197
|
+
this$static.co[7] = (15 - twst) % 3;
|
|
1198
|
+
}
|
|
1199
|
+
function CornMult_0(a, b, prod) {
|
|
1200
|
+
let corn;
|
|
1201
|
+
let ori;
|
|
1202
|
+
let oriA;
|
|
1203
|
+
let oriB;
|
|
1204
|
+
for (corn = 0; corn < 8; ++corn) {
|
|
1205
|
+
prod.cp[corn] = a.cp[b.cp[corn]];
|
|
1206
|
+
oriA = a.co[b.cp[corn]];
|
|
1207
|
+
oriB = b.co[corn];
|
|
1208
|
+
ori = oriA;
|
|
1209
|
+
ori = ori + (oriA < 3 ? oriB : 6 - oriB);
|
|
1210
|
+
ori = ori % 3;
|
|
1211
|
+
(oriA >= 3 ? 1 : 0) ^ (oriB >= 3 ? 1 : 0) && (ori = ori + 3);
|
|
1212
|
+
prod.co[corn] = ori;
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
function CornerCube_0() {
|
|
1216
|
+
$$init_2(this);
|
|
1217
|
+
}
|
|
1218
|
+
function CornerCube_1(cperm, twist) {
|
|
1219
|
+
$$init_2(this);
|
|
1220
|
+
set8Perm(this.cp, cperm);
|
|
1221
|
+
$setTwist_0(this, twist);
|
|
1222
|
+
}
|
|
1223
|
+
function CornerCube_2() {
|
|
1224
|
+
CornerCube_1.call(this, randomUIntBelow(40320), randomUIntBelow(2187));
|
|
1225
|
+
}
|
|
1226
|
+
function initMove_0() {
|
|
1227
|
+
let a;
|
|
1228
|
+
let p_0;
|
|
1229
|
+
moveCube_0[0] = new CornerCube_1(15120, 0);
|
|
1230
|
+
moveCube_0[3] = new CornerCube_1(21021, 1494);
|
|
1231
|
+
moveCube_0[6] = new CornerCube_1(8064, 1236);
|
|
1232
|
+
moveCube_0[9] = new CornerCube_1(9, 0);
|
|
1233
|
+
moveCube_0[12] = new CornerCube_1(1230, 412);
|
|
1234
|
+
moveCube_0[15] = new CornerCube_1(224, 137);
|
|
1235
|
+
for (a = 0; a < 18; a += 3) {
|
|
1236
|
+
for (p_0 = 0; p_0 < 2; ++p_0) {
|
|
1237
|
+
moveCube_0[a + p_0 + 1] = new CornerCube_0();
|
|
1238
|
+
CornMult_0(moveCube_0[a + p_0], moveCube_0[a], moveCube_0[a + p_0 + 1]);
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
defineSeed(
|
|
1243
|
+
157,
|
|
1244
|
+
1,
|
|
1245
|
+
makeCastMap([Q$CornerCube]),
|
|
1246
|
+
CornerCube_0,
|
|
1247
|
+
CornerCube_1,
|
|
1248
|
+
CornerCube_2
|
|
1249
|
+
);
|
|
1250
|
+
_.temps = null;
|
|
1251
|
+
var moveCube_0;
|
|
1252
|
+
var ran$clinit_Edge3 = false;
|
|
1253
|
+
function $clinit_Edge3() {
|
|
1254
|
+
if (ran$clinit_Edge3) {
|
|
1255
|
+
return;
|
|
1256
|
+
}
|
|
1257
|
+
ran$clinit_Edge3 = true;
|
|
1258
|
+
eprun = createArray(1937880);
|
|
1259
|
+
sym2raw_0 = createArray(1538);
|
|
1260
|
+
symstate = createArray(1538);
|
|
1261
|
+
raw2sym_1 = createArray(11880);
|
|
1262
|
+
syminv_0 = [0, 1, 6, 3, 4, 5, 2, 7];
|
|
1263
|
+
mvrot = createArray(160, 12);
|
|
1264
|
+
mvroto = createArray(160, 12);
|
|
1265
|
+
factX = [
|
|
1266
|
+
1,
|
|
1267
|
+
1,
|
|
1268
|
+
1,
|
|
1269
|
+
3,
|
|
1270
|
+
12,
|
|
1271
|
+
60,
|
|
1272
|
+
360,
|
|
1273
|
+
2520,
|
|
1274
|
+
20160,
|
|
1275
|
+
181440,
|
|
1276
|
+
1814400,
|
|
1277
|
+
19958400,
|
|
1278
|
+
239500800
|
|
1279
|
+
];
|
|
1280
|
+
FullEdgeMap = [0, 2, 4, 6, 1, 3, 7, 5, 8, 9, 10, 11];
|
|
1281
|
+
}
|
|
1282
|
+
function $circlex(this$static, a, b, c, d) {
|
|
1283
|
+
const temp = this$static.edgeo[d];
|
|
1284
|
+
this$static.edgeo[d] = this$static.edge[c];
|
|
1285
|
+
this$static.edge[c] = this$static.edgeo[b];
|
|
1286
|
+
this$static.edgeo[b] = this$static.edge[a];
|
|
1287
|
+
this$static.edge[a] = temp;
|
|
1288
|
+
}
|
|
1289
|
+
function $get_2(this$static, end) {
|
|
1290
|
+
let i_0;
|
|
1291
|
+
let idx;
|
|
1292
|
+
let v;
|
|
1293
|
+
let valh;
|
|
1294
|
+
let vall;
|
|
1295
|
+
this$static.isStd || $std(this$static);
|
|
1296
|
+
idx = 0;
|
|
1297
|
+
vall = 1985229328;
|
|
1298
|
+
valh = 47768;
|
|
1299
|
+
for (i_0 = 0; i_0 < end; ++i_0) {
|
|
1300
|
+
v = this$static.edge[i_0] << 2;
|
|
1301
|
+
idx *= 12 - i_0;
|
|
1302
|
+
if (v >= 32) {
|
|
1303
|
+
idx += valh >> v - 32 & 15;
|
|
1304
|
+
valh -= 4368 << v - 32;
|
|
1305
|
+
} else {
|
|
1306
|
+
idx += vall >> v & 15;
|
|
1307
|
+
valh -= 4369;
|
|
1308
|
+
vall -= 286331152 << v;
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
return idx;
|
|
1312
|
+
}
|
|
1313
|
+
function $getsym_0(this$static) {
|
|
1314
|
+
let symcord1x;
|
|
1315
|
+
const cord1x = $get_2(this$static, 4);
|
|
1316
|
+
symcord1x = raw2sym_1[cord1x];
|
|
1317
|
+
const symx = symcord1x & 7;
|
|
1318
|
+
symcord1x >>= 3;
|
|
1319
|
+
$rotate_0(this$static, symx);
|
|
1320
|
+
const cord2x = $get_2(this$static, 10) % 20160;
|
|
1321
|
+
return symcord1x * 20160 + cord2x;
|
|
1322
|
+
}
|
|
1323
|
+
function $move_4(this$static, i_0) {
|
|
1324
|
+
this$static.isStd = false;
|
|
1325
|
+
switch (i_0) {
|
|
1326
|
+
case 0: {
|
|
1327
|
+
circle(this$static.edge, 0, 4, 1, 5);
|
|
1328
|
+
circle(this$static.edgeo, 0, 4, 1, 5);
|
|
1329
|
+
break;
|
|
1330
|
+
}
|
|
1331
|
+
case 1: {
|
|
1332
|
+
$swap_0(this$static.edge, 0, 4, 1, 5);
|
|
1333
|
+
$swap_0(this$static.edgeo, 0, 4, 1, 5);
|
|
1334
|
+
break;
|
|
1335
|
+
}
|
|
1336
|
+
case 2: {
|
|
1337
|
+
circle(this$static.edge, 0, 5, 1, 4);
|
|
1338
|
+
circle(this$static.edgeo, 0, 5, 1, 4);
|
|
1339
|
+
break;
|
|
1340
|
+
}
|
|
1341
|
+
case 3: {
|
|
1342
|
+
$swap_0(this$static.edge, 5, 10, 6, 11);
|
|
1343
|
+
$swap_0(this$static.edgeo, 5, 10, 6, 11);
|
|
1344
|
+
break;
|
|
1345
|
+
}
|
|
1346
|
+
case 4: {
|
|
1347
|
+
circle(this$static.edge, 0, 11, 3, 8);
|
|
1348
|
+
circle(this$static.edgeo, 0, 11, 3, 8);
|
|
1349
|
+
break;
|
|
1350
|
+
}
|
|
1351
|
+
case 5: {
|
|
1352
|
+
$swap_0(this$static.edge, 0, 11, 3, 8);
|
|
1353
|
+
$swap_0(this$static.edgeo, 0, 11, 3, 8);
|
|
1354
|
+
break;
|
|
1355
|
+
}
|
|
1356
|
+
case 6: {
|
|
1357
|
+
circle(this$static.edge, 0, 8, 3, 11);
|
|
1358
|
+
circle(this$static.edgeo, 0, 8, 3, 11);
|
|
1359
|
+
break;
|
|
1360
|
+
}
|
|
1361
|
+
case 7: {
|
|
1362
|
+
circle(this$static.edge, 2, 7, 3, 6);
|
|
1363
|
+
circle(this$static.edgeo, 2, 7, 3, 6);
|
|
1364
|
+
break;
|
|
1365
|
+
}
|
|
1366
|
+
case 8: {
|
|
1367
|
+
$swap_0(this$static.edge, 2, 7, 3, 6);
|
|
1368
|
+
$swap_0(this$static.edgeo, 2, 7, 3, 6);
|
|
1369
|
+
break;
|
|
1370
|
+
}
|
|
1371
|
+
case 9: {
|
|
1372
|
+
circle(this$static.edge, 2, 6, 3, 7);
|
|
1373
|
+
circle(this$static.edgeo, 2, 6, 3, 7);
|
|
1374
|
+
break;
|
|
1375
|
+
}
|
|
1376
|
+
case 10: {
|
|
1377
|
+
$swap_0(this$static.edge, 4, 8, 7, 9);
|
|
1378
|
+
$swap_0(this$static.edgeo, 4, 8, 7, 9);
|
|
1379
|
+
break;
|
|
1380
|
+
}
|
|
1381
|
+
case 11: {
|
|
1382
|
+
circle(this$static.edge, 1, 9, 2, 10);
|
|
1383
|
+
circle(this$static.edgeo, 1, 9, 2, 10);
|
|
1384
|
+
break;
|
|
1385
|
+
}
|
|
1386
|
+
case 12: {
|
|
1387
|
+
$swap_0(this$static.edge, 1, 9, 2, 10);
|
|
1388
|
+
$swap_0(this$static.edgeo, 1, 9, 2, 10);
|
|
1389
|
+
break;
|
|
1390
|
+
}
|
|
1391
|
+
case 13: {
|
|
1392
|
+
circle(this$static.edge, 1, 10, 2, 9);
|
|
1393
|
+
circle(this$static.edgeo, 1, 10, 2, 9);
|
|
1394
|
+
break;
|
|
1395
|
+
}
|
|
1396
|
+
case 14: {
|
|
1397
|
+
$swap_0(this$static.edge, 0, 4, 1, 5);
|
|
1398
|
+
$swap_0(this$static.edgeo, 0, 4, 1, 5);
|
|
1399
|
+
circle(this$static.edge, 9, 11);
|
|
1400
|
+
circle(this$static.edgeo, 8, 10);
|
|
1401
|
+
break;
|
|
1402
|
+
}
|
|
1403
|
+
case 15: {
|
|
1404
|
+
$swap_0(this$static.edge, 5, 10, 6, 11);
|
|
1405
|
+
$swap_0(this$static.edgeo, 5, 10, 6, 11);
|
|
1406
|
+
circle(this$static.edge, 1, 3);
|
|
1407
|
+
circle(this$static.edgeo, 0, 2);
|
|
1408
|
+
break;
|
|
1409
|
+
}
|
|
1410
|
+
case 16: {
|
|
1411
|
+
$swap_0(this$static.edge, 0, 11, 3, 8);
|
|
1412
|
+
$swap_0(this$static.edgeo, 0, 11, 3, 8);
|
|
1413
|
+
circle(this$static.edge, 5, 7);
|
|
1414
|
+
circle(this$static.edgeo, 4, 6);
|
|
1415
|
+
break;
|
|
1416
|
+
}
|
|
1417
|
+
case 17: {
|
|
1418
|
+
$swap_0(this$static.edge, 2, 7, 3, 6);
|
|
1419
|
+
$swap_0(this$static.edgeo, 2, 7, 3, 6);
|
|
1420
|
+
circle(this$static.edge, 8, 10);
|
|
1421
|
+
circle(this$static.edgeo, 9, 11);
|
|
1422
|
+
break;
|
|
1423
|
+
}
|
|
1424
|
+
case 18: {
|
|
1425
|
+
$swap_0(this$static.edge, 4, 8, 7, 9);
|
|
1426
|
+
$swap_0(this$static.edgeo, 4, 8, 7, 9);
|
|
1427
|
+
circle(this$static.edge, 0, 2);
|
|
1428
|
+
circle(this$static.edgeo, 1, 3);
|
|
1429
|
+
break;
|
|
1430
|
+
}
|
|
1431
|
+
case 19: {
|
|
1432
|
+
$swap_0(this$static.edge, 1, 9, 2, 10);
|
|
1433
|
+
$swap_0(this$static.edgeo, 1, 9, 2, 10);
|
|
1434
|
+
circle(this$static.edge, 4, 6);
|
|
1435
|
+
circle(this$static.edgeo, 5, 7);
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
function $rot_1(this$static, r) {
|
|
1440
|
+
this$static.isStd = false;
|
|
1441
|
+
switch (r) {
|
|
1442
|
+
case 0: {
|
|
1443
|
+
$move_4(this$static, 14);
|
|
1444
|
+
$move_4(this$static, 17);
|
|
1445
|
+
break;
|
|
1446
|
+
}
|
|
1447
|
+
case 1: {
|
|
1448
|
+
$circlex(this$static, 11, 5, 10, 6);
|
|
1449
|
+
$circlex(this$static, 5, 10, 6, 11);
|
|
1450
|
+
$circlex(this$static, 1, 2, 3, 0);
|
|
1451
|
+
$circlex(this$static, 4, 9, 7, 8);
|
|
1452
|
+
$circlex(this$static, 8, 4, 9, 7);
|
|
1453
|
+
$circlex(this$static, 0, 1, 2, 3);
|
|
1454
|
+
break;
|
|
1455
|
+
}
|
|
1456
|
+
case 2: {
|
|
1457
|
+
$swapx(this$static, 4, 5);
|
|
1458
|
+
$swapx(this$static, 5, 4);
|
|
1459
|
+
$swapx(this$static, 11, 8);
|
|
1460
|
+
$swapx(this$static, 8, 11);
|
|
1461
|
+
$swapx(this$static, 7, 6);
|
|
1462
|
+
$swapx(this$static, 6, 7);
|
|
1463
|
+
$swapx(this$static, 9, 10);
|
|
1464
|
+
$swapx(this$static, 10, 9);
|
|
1465
|
+
$swapx(this$static, 1, 1);
|
|
1466
|
+
$swapx(this$static, 0, 0);
|
|
1467
|
+
$swapx(this$static, 3, 3);
|
|
1468
|
+
$swapx(this$static, 2, 2);
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
function $rotate_0(this$static, r) {
|
|
1473
|
+
while (r >= 2) {
|
|
1474
|
+
r -= 2;
|
|
1475
|
+
$rot_1(this$static, 1);
|
|
1476
|
+
$rot_1(this$static, 2);
|
|
1477
|
+
}
|
|
1478
|
+
r !== 0 && $rot_1(this$static, 0);
|
|
1479
|
+
}
|
|
1480
|
+
function $set_4(this$static, idx) {
|
|
1481
|
+
let i_0;
|
|
1482
|
+
let p_0;
|
|
1483
|
+
let parity;
|
|
1484
|
+
let v;
|
|
1485
|
+
let vall;
|
|
1486
|
+
let valh;
|
|
1487
|
+
vall = 1985229328;
|
|
1488
|
+
valh = 47768;
|
|
1489
|
+
parity = 0;
|
|
1490
|
+
for (i_0 = 0; i_0 < 11; ++i_0) {
|
|
1491
|
+
p_0 = factX[11 - i_0];
|
|
1492
|
+
v = ~~(idx / p_0);
|
|
1493
|
+
idx = idx % p_0;
|
|
1494
|
+
parity ^= v;
|
|
1495
|
+
v <<= 2;
|
|
1496
|
+
if (v >= 32) {
|
|
1497
|
+
v = v - 32;
|
|
1498
|
+
this$static.edge[i_0] = valh >> v & 15;
|
|
1499
|
+
const m = (1 << v) - 1;
|
|
1500
|
+
valh = (valh & m) + (valh >> 4 & ~m);
|
|
1501
|
+
} else {
|
|
1502
|
+
this$static.edge[i_0] = vall >> v & 15;
|
|
1503
|
+
const m = (1 << v) - 1;
|
|
1504
|
+
vall = (vall & m) + (vall >>> 4 & ~m) + (valh << 28);
|
|
1505
|
+
valh = valh >> 4;
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
if ((parity & 1) === 0) {
|
|
1509
|
+
this$static.edge[11] = vall;
|
|
1510
|
+
} else {
|
|
1511
|
+
this$static.edge[11] = this$static.edge[10];
|
|
1512
|
+
this$static.edge[10] = vall;
|
|
1513
|
+
}
|
|
1514
|
+
for (i_0 = 0; i_0 < 12; ++i_0) {
|
|
1515
|
+
this$static.edgeo[i_0] = i_0;
|
|
1516
|
+
}
|
|
1517
|
+
this$static.isStd = true;
|
|
1518
|
+
}
|
|
1519
|
+
function $set_5(this$static, e) {
|
|
1520
|
+
let i_0;
|
|
1521
|
+
for (i_0 = 0; i_0 < 12; ++i_0) {
|
|
1522
|
+
this$static.edge[i_0] = e.edge[i_0];
|
|
1523
|
+
this$static.edgeo[i_0] = e.edgeo[i_0];
|
|
1524
|
+
}
|
|
1525
|
+
this$static.isStd = e.isStd;
|
|
1526
|
+
}
|
|
1527
|
+
function $set_6(this$static, c) {
|
|
1528
|
+
let i_0;
|
|
1529
|
+
let parity;
|
|
1530
|
+
let s;
|
|
1531
|
+
let t;
|
|
1532
|
+
this$static.temp === null && (this$static.temp = createArray(12));
|
|
1533
|
+
for (i_0 = 0; i_0 < 12; ++i_0) {
|
|
1534
|
+
this$static.temp[i_0] = i_0;
|
|
1535
|
+
this$static.edge[i_0] = c.ep[FullEdgeMap[i_0] + 12] % 12;
|
|
1536
|
+
}
|
|
1537
|
+
parity = 1;
|
|
1538
|
+
for (i_0 = 0; i_0 < 12; ++i_0) {
|
|
1539
|
+
while (this$static.edge[i_0] !== i_0) {
|
|
1540
|
+
t = this$static.edge[i_0];
|
|
1541
|
+
this$static.edge[i_0] = this$static.edge[t];
|
|
1542
|
+
this$static.edge[t] = t;
|
|
1543
|
+
s = this$static.temp[i_0];
|
|
1544
|
+
this$static.temp[i_0] = this$static.temp[t];
|
|
1545
|
+
this$static.temp[t] = s;
|
|
1546
|
+
parity ^= 1;
|
|
1547
|
+
}
|
|
1548
|
+
}
|
|
1549
|
+
for (i_0 = 0; i_0 < 12; ++i_0) {
|
|
1550
|
+
this$static.edge[i_0] = this$static.temp[c.ep[FullEdgeMap[i_0]] % 12];
|
|
1551
|
+
}
|
|
1552
|
+
return parity;
|
|
1553
|
+
}
|
|
1554
|
+
function $std(this$static) {
|
|
1555
|
+
let i_0;
|
|
1556
|
+
this$static.temp === null && (this$static.temp = createArray(12));
|
|
1557
|
+
for (i_0 = 0; i_0 < 12; ++i_0) {
|
|
1558
|
+
this$static.temp[this$static.edgeo[i_0]] = i_0;
|
|
1559
|
+
}
|
|
1560
|
+
for (i_0 = 0; i_0 < 12; ++i_0) {
|
|
1561
|
+
this$static.edge[i_0] = this$static.temp[this$static.edge[i_0]];
|
|
1562
|
+
this$static.edgeo[i_0] = i_0;
|
|
1563
|
+
}
|
|
1564
|
+
this$static.isStd = true;
|
|
1565
|
+
}
|
|
1566
|
+
function $swap_0(arr, a, b, c, d) {
|
|
1567
|
+
let temp;
|
|
1568
|
+
temp = arr[a];
|
|
1569
|
+
arr[a] = arr[c];
|
|
1570
|
+
arr[c] = temp;
|
|
1571
|
+
temp = arr[b];
|
|
1572
|
+
arr[b] = arr[d];
|
|
1573
|
+
arr[d] = temp;
|
|
1574
|
+
}
|
|
1575
|
+
function $swapx(this$static, x, y) {
|
|
1576
|
+
const temp = this$static.edge[x];
|
|
1577
|
+
this$static.edge[x] = this$static.edgeo[y];
|
|
1578
|
+
this$static.edgeo[y] = temp;
|
|
1579
|
+
}
|
|
1580
|
+
function Edge3_0() {
|
|
1581
|
+
this.edge = createArray(12);
|
|
1582
|
+
this.edgeo = createArray(12);
|
|
1583
|
+
}
|
|
1584
|
+
function createPrun_0() {
|
|
1585
|
+
let chk;
|
|
1586
|
+
let cord1;
|
|
1587
|
+
let cord1x;
|
|
1588
|
+
let cord2;
|
|
1589
|
+
let cord2x;
|
|
1590
|
+
let dep1m3;
|
|
1591
|
+
let depm3;
|
|
1592
|
+
let depth;
|
|
1593
|
+
let end;
|
|
1594
|
+
let find_0;
|
|
1595
|
+
let i_0;
|
|
1596
|
+
let i_;
|
|
1597
|
+
let idx;
|
|
1598
|
+
let idxx;
|
|
1599
|
+
let inv;
|
|
1600
|
+
let j;
|
|
1601
|
+
let m_0;
|
|
1602
|
+
let symState;
|
|
1603
|
+
let symcord1;
|
|
1604
|
+
let symcord1x;
|
|
1605
|
+
let symx;
|
|
1606
|
+
let val;
|
|
1607
|
+
const e = new Edge3_0();
|
|
1608
|
+
const f = new Edge3_0();
|
|
1609
|
+
const g = new Edge3_0();
|
|
1610
|
+
fill_0(eprun);
|
|
1611
|
+
depth = 0;
|
|
1612
|
+
done_0 = 1;
|
|
1613
|
+
setPruning_0(eprun, 0, 0);
|
|
1614
|
+
while (done_0 !== 31006080) {
|
|
1615
|
+
inv = depth > 9;
|
|
1616
|
+
depm3 = depth % 3;
|
|
1617
|
+
dep1m3 = (depth + 1) % 3;
|
|
1618
|
+
find_0 = inv ? 3 : depm3;
|
|
1619
|
+
chk = inv ? depm3 : 3;
|
|
1620
|
+
if (depth >= 9) {
|
|
1621
|
+
break;
|
|
1622
|
+
}
|
|
1623
|
+
for (i_ = 0; i_ < 31006080; i_ += 16) {
|
|
1624
|
+
val = eprun[~~i_ >> 4];
|
|
1625
|
+
if (!inv && val === -1) {
|
|
1626
|
+
continue;
|
|
1627
|
+
}
|
|
1628
|
+
for (i_0 = i_, end = i_ + 16; i_0 < end; ++i_0, val >>= 2) {
|
|
1629
|
+
if ((val & 3) !== find_0) {
|
|
1630
|
+
continue;
|
|
1631
|
+
}
|
|
1632
|
+
symcord1 = ~~(i_0 / 20160);
|
|
1633
|
+
cord1 = sym2raw_0[symcord1];
|
|
1634
|
+
cord2 = i_0 % 20160;
|
|
1635
|
+
$set_4(e, cord1 * 20160 + cord2);
|
|
1636
|
+
for (m_0 = 0; m_0 < 17; ++m_0) {
|
|
1637
|
+
cord1x = getmvrot(e.edge, m_0 << 3, 4);
|
|
1638
|
+
symcord1x = raw2sym_1[cord1x];
|
|
1639
|
+
symx = symcord1x & 7;
|
|
1640
|
+
symcord1x >>= 3;
|
|
1641
|
+
cord2x = getmvrot(e.edge, m_0 << 3 | symx, 10) % 20160;
|
|
1642
|
+
idx = symcord1x * 20160 + cord2x;
|
|
1643
|
+
if (getPruning_0(eprun, idx) !== chk) {
|
|
1644
|
+
continue;
|
|
1645
|
+
}
|
|
1646
|
+
setPruning_0(eprun, inv ? i_0 : idx, dep1m3);
|
|
1647
|
+
++done_0;
|
|
1648
|
+
if (inv) {
|
|
1649
|
+
break;
|
|
1650
|
+
}
|
|
1651
|
+
symState = symstate[symcord1x];
|
|
1652
|
+
if (symState === 1) {
|
|
1653
|
+
continue;
|
|
1654
|
+
}
|
|
1655
|
+
$set_5(f, e);
|
|
1656
|
+
$move_4(f, m_0);
|
|
1657
|
+
$rotate_0(f, symx);
|
|
1658
|
+
for (j = 1; (symState = ~~symState >> 1 & 65535) !== 0; ++j) {
|
|
1659
|
+
if ((symState & 1) !== 1) {
|
|
1660
|
+
continue;
|
|
1661
|
+
}
|
|
1662
|
+
$set_5(g, f);
|
|
1663
|
+
$rotate_0(g, j);
|
|
1664
|
+
idxx = symcord1x * 20160 + $get_2(g, 10) % 20160;
|
|
1665
|
+
if (getPruning_0(eprun, idxx) === chk) {
|
|
1666
|
+
setPruning_0(eprun, idxx, dep1m3);
|
|
1667
|
+
++done_0;
|
|
1668
|
+
}
|
|
1669
|
+
}
|
|
1670
|
+
}
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
++depth;
|
|
1674
|
+
}
|
|
1675
|
+
}
|
|
1676
|
+
function getPruning_0(table, index) {
|
|
1677
|
+
return table[index >> 4] >> ((index & 15) << 1) & 3;
|
|
1678
|
+
}
|
|
1679
|
+
function getmvrot(ep, mrIdx, end) {
|
|
1680
|
+
let i_0;
|
|
1681
|
+
let idx;
|
|
1682
|
+
let v;
|
|
1683
|
+
let valh;
|
|
1684
|
+
let vall;
|
|
1685
|
+
const movo = mvroto[mrIdx];
|
|
1686
|
+
const mov = mvrot[mrIdx];
|
|
1687
|
+
idx = 0;
|
|
1688
|
+
vall = 1985229328;
|
|
1689
|
+
valh = 47768;
|
|
1690
|
+
for (i_0 = 0; i_0 < end; ++i_0) {
|
|
1691
|
+
v = movo[ep[mov[i_0]]] << 2;
|
|
1692
|
+
idx *= 12 - i_0;
|
|
1693
|
+
if (v >= 32) {
|
|
1694
|
+
idx += valh >> v - 32 & 15;
|
|
1695
|
+
valh -= 4368 << v - 32;
|
|
1696
|
+
} else {
|
|
1697
|
+
idx += vall >> v & 15;
|
|
1698
|
+
valh -= 4369;
|
|
1699
|
+
vall -= 286331152 << v;
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
1702
|
+
return idx;
|
|
1703
|
+
}
|
|
1704
|
+
function getprun(edge) {
|
|
1705
|
+
let cord1;
|
|
1706
|
+
let cord1x;
|
|
1707
|
+
let cord2;
|
|
1708
|
+
let cord2x;
|
|
1709
|
+
let depm3;
|
|
1710
|
+
let depth;
|
|
1711
|
+
let idx;
|
|
1712
|
+
let m_0;
|
|
1713
|
+
let symcord1;
|
|
1714
|
+
let symcord1x;
|
|
1715
|
+
let symx;
|
|
1716
|
+
const e = new Edge3_0();
|
|
1717
|
+
depth = 0;
|
|
1718
|
+
depm3 = getPruning_0(eprun, edge);
|
|
1719
|
+
if (depm3 === 3) {
|
|
1720
|
+
return 10;
|
|
1721
|
+
}
|
|
1722
|
+
while (edge !== 0) {
|
|
1723
|
+
depm3 === 0 ? depm3 = 2 : --depm3;
|
|
1724
|
+
symcord1 = ~~(edge / 20160);
|
|
1725
|
+
cord1 = sym2raw_0[symcord1];
|
|
1726
|
+
cord2 = edge % 20160;
|
|
1727
|
+
$set_4(e, cord1 * 20160 + cord2);
|
|
1728
|
+
for (m_0 = 0; m_0 < 17; ++m_0) {
|
|
1729
|
+
cord1x = getmvrot(e.edge, m_0 << 3, 4);
|
|
1730
|
+
symcord1x = raw2sym_1[cord1x];
|
|
1731
|
+
symx = symcord1x & 7;
|
|
1732
|
+
symcord1x >>= 3;
|
|
1733
|
+
cord2x = getmvrot(e.edge, m_0 << 3 | symx, 10) % 20160;
|
|
1734
|
+
idx = symcord1x * 20160 + cord2x;
|
|
1735
|
+
if (getPruning_0(eprun, idx) === depm3) {
|
|
1736
|
+
++depth;
|
|
1737
|
+
edge = idx;
|
|
1738
|
+
break;
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1741
|
+
}
|
|
1742
|
+
return depth;
|
|
1743
|
+
}
|
|
1744
|
+
function getprun_0(edge, prun) {
|
|
1745
|
+
const depm3 = getPruning_0(eprun, edge);
|
|
1746
|
+
if (depm3 === 3) {
|
|
1747
|
+
return 10;
|
|
1748
|
+
}
|
|
1749
|
+
return (1227133513 << depm3 >> prun & 3) + prun - 1;
|
|
1750
|
+
}
|
|
1751
|
+
function initMvrot() {
|
|
1752
|
+
let i_0;
|
|
1753
|
+
let m_0;
|
|
1754
|
+
let r;
|
|
1755
|
+
const e = new Edge3_0();
|
|
1756
|
+
for (m_0 = 0; m_0 < 20; ++m_0) {
|
|
1757
|
+
for (r = 0; r < 8; ++r) {
|
|
1758
|
+
$set_4(e, 0);
|
|
1759
|
+
$move_4(e, m_0);
|
|
1760
|
+
$rotate_0(e, r);
|
|
1761
|
+
for (i_0 = 0; i_0 < 12; ++i_0) {
|
|
1762
|
+
mvrot[m_0 << 3 | r][i_0] = e.edge[i_0];
|
|
1763
|
+
}
|
|
1764
|
+
$std(e);
|
|
1765
|
+
for (i_0 = 0; i_0 < 12; ++i_0) {
|
|
1766
|
+
mvroto[m_0 << 3 | r][i_0] = e.temp[i_0];
|
|
1767
|
+
}
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
}
|
|
1771
|
+
function initRaw2Sym() {
|
|
1772
|
+
let count;
|
|
1773
|
+
let i_0;
|
|
1774
|
+
let idx;
|
|
1775
|
+
let j;
|
|
1776
|
+
const e = new Edge3_0();
|
|
1777
|
+
const occ = createArray(1485);
|
|
1778
|
+
for (i_0 = 0; i_0 < 1485; i_0++) {
|
|
1779
|
+
occ[i_0] = 0;
|
|
1780
|
+
}
|
|
1781
|
+
count = 0;
|
|
1782
|
+
for (i_0 = 0; i_0 < 11880; ++i_0) {
|
|
1783
|
+
if ((occ[~~i_0 >>> 3] & 1 << (i_0 & 7)) === 0) {
|
|
1784
|
+
$set_4(e, i_0 * factX[8]);
|
|
1785
|
+
for (j = 0; j < 8; ++j) {
|
|
1786
|
+
idx = $get_2(e, 4);
|
|
1787
|
+
idx === i_0 && (symstate[count] = (symstate[count] | 1 << j) & 65535);
|
|
1788
|
+
occ[~~idx >> 3] = occ[~~idx >> 3] | 1 << (idx & 7);
|
|
1789
|
+
raw2sym_1[idx] = count << 3 | syminv_0[j];
|
|
1790
|
+
$rot_1(e, 0);
|
|
1791
|
+
if (j % 2 === 1) {
|
|
1792
|
+
$rot_1(e, 1);
|
|
1793
|
+
$rot_1(e, 2);
|
|
1794
|
+
}
|
|
1795
|
+
}
|
|
1796
|
+
sym2raw_0[count++] = i_0;
|
|
1797
|
+
}
|
|
1798
|
+
}
|
|
1799
|
+
}
|
|
1800
|
+
function setPruning_0(table, index, value) {
|
|
1801
|
+
table[index >> 4] ^= (3 ^ value) << ((index & 15) << 1);
|
|
1802
|
+
}
|
|
1803
|
+
defineSeed(158, 1, makeCastMap([Q$Edge3]), Edge3_0);
|
|
1804
|
+
_.isStd = true;
|
|
1805
|
+
_.temp = null;
|
|
1806
|
+
var FullEdgeMap;
|
|
1807
|
+
var done_0 = 0;
|
|
1808
|
+
var eprun;
|
|
1809
|
+
var factX;
|
|
1810
|
+
var mvrot;
|
|
1811
|
+
var mvroto;
|
|
1812
|
+
var raw2sym_1;
|
|
1813
|
+
var sym2raw_0;
|
|
1814
|
+
var syminv_0;
|
|
1815
|
+
var symstate;
|
|
1816
|
+
var ran$clinit_EdgeCube = false;
|
|
1817
|
+
function $clinit_EdgeCube() {
|
|
1818
|
+
if (ran$clinit_EdgeCube) {
|
|
1819
|
+
return;
|
|
1820
|
+
}
|
|
1821
|
+
ran$clinit_EdgeCube = true;
|
|
1822
|
+
}
|
|
1823
|
+
function $checkEdge(this$static) {
|
|
1824
|
+
let ck;
|
|
1825
|
+
let i_0;
|
|
1826
|
+
let parity;
|
|
1827
|
+
ck = 0;
|
|
1828
|
+
parity = false;
|
|
1829
|
+
for (i_0 = 0; i_0 < 12; ++i_0) {
|
|
1830
|
+
ck |= 1 << this$static.ep[i_0];
|
|
1831
|
+
parity = parity !== this$static.ep[i_0] >= 12;
|
|
1832
|
+
}
|
|
1833
|
+
ck &= ~~ck >> 12;
|
|
1834
|
+
return ck === 0 && !parity;
|
|
1835
|
+
}
|
|
1836
|
+
function $copy_3(this$static, c) {
|
|
1837
|
+
let i_0;
|
|
1838
|
+
for (i_0 = 0; i_0 < 24; ++i_0) {
|
|
1839
|
+
this$static.ep[i_0] = c.ep[i_0];
|
|
1840
|
+
}
|
|
1841
|
+
}
|
|
1842
|
+
function $move_5(this$static, m_0) {
|
|
1843
|
+
const key = m_0 % 3;
|
|
1844
|
+
m_0 = ~~(m_0 / 3);
|
|
1845
|
+
switch (m_0) {
|
|
1846
|
+
case 0: {
|
|
1847
|
+
swap(this$static.ep, 0, 1, 2, 3, key);
|
|
1848
|
+
swap(this$static.ep, 12, 13, 14, 15, key);
|
|
1849
|
+
break;
|
|
1850
|
+
}
|
|
1851
|
+
case 1: {
|
|
1852
|
+
swap(this$static.ep, 11, 15, 10, 19, key);
|
|
1853
|
+
swap(this$static.ep, 23, 3, 22, 7, key);
|
|
1854
|
+
break;
|
|
1855
|
+
}
|
|
1856
|
+
case 2: {
|
|
1857
|
+
swap(this$static.ep, 0, 11, 6, 8, key);
|
|
1858
|
+
swap(this$static.ep, 12, 23, 18, 20, key);
|
|
1859
|
+
break;
|
|
1860
|
+
}
|
|
1861
|
+
case 3: {
|
|
1862
|
+
swap(this$static.ep, 4, 5, 6, 7, key);
|
|
1863
|
+
swap(this$static.ep, 16, 17, 18, 19, key);
|
|
1864
|
+
break;
|
|
1865
|
+
}
|
|
1866
|
+
case 4: {
|
|
1867
|
+
swap(this$static.ep, 1, 20, 5, 21, key);
|
|
1868
|
+
swap(this$static.ep, 13, 8, 17, 9, key);
|
|
1869
|
+
break;
|
|
1870
|
+
}
|
|
1871
|
+
case 5: {
|
|
1872
|
+
swap(this$static.ep, 2, 9, 4, 10, key);
|
|
1873
|
+
swap(this$static.ep, 14, 21, 16, 22, key);
|
|
1874
|
+
break;
|
|
1875
|
+
}
|
|
1876
|
+
case 6: {
|
|
1877
|
+
swap(this$static.ep, 0, 1, 2, 3, key);
|
|
1878
|
+
swap(this$static.ep, 12, 13, 14, 15, key);
|
|
1879
|
+
swap(this$static.ep, 9, 22, 11, 20, key);
|
|
1880
|
+
break;
|
|
1881
|
+
}
|
|
1882
|
+
case 7: {
|
|
1883
|
+
swap(this$static.ep, 11, 15, 10, 19, key);
|
|
1884
|
+
swap(this$static.ep, 23, 3, 22, 7, key);
|
|
1885
|
+
swap(this$static.ep, 2, 16, 6, 12, key);
|
|
1886
|
+
break;
|
|
1887
|
+
}
|
|
1888
|
+
case 8: {
|
|
1889
|
+
swap(this$static.ep, 0, 11, 6, 8, key);
|
|
1890
|
+
swap(this$static.ep, 12, 23, 18, 20, key);
|
|
1891
|
+
swap(this$static.ep, 3, 19, 5, 13, key);
|
|
1892
|
+
break;
|
|
1893
|
+
}
|
|
1894
|
+
case 9: {
|
|
1895
|
+
swap(this$static.ep, 4, 5, 6, 7, key);
|
|
1896
|
+
swap(this$static.ep, 16, 17, 18, 19, key);
|
|
1897
|
+
swap(this$static.ep, 8, 23, 10, 21, key);
|
|
1898
|
+
break;
|
|
1899
|
+
}
|
|
1900
|
+
case 10: {
|
|
1901
|
+
swap(this$static.ep, 1, 20, 5, 21, key);
|
|
1902
|
+
swap(this$static.ep, 13, 8, 17, 9, key);
|
|
1903
|
+
swap(this$static.ep, 14, 0, 18, 4, key);
|
|
1904
|
+
break;
|
|
1905
|
+
}
|
|
1906
|
+
case 11: {
|
|
1907
|
+
swap(this$static.ep, 2, 9, 4, 10, key);
|
|
1908
|
+
swap(this$static.ep, 14, 21, 16, 22, key);
|
|
1909
|
+
swap(this$static.ep, 7, 15, 1, 17, key);
|
|
1910
|
+
}
|
|
1911
|
+
}
|
|
1912
|
+
}
|
|
1913
|
+
function EdgeCube_0() {
|
|
1914
|
+
let i_0;
|
|
1915
|
+
this.ep = createArray(24);
|
|
1916
|
+
for (i_0 = 0; i_0 < 24; ++i_0) {
|
|
1917
|
+
this.ep[i_0] = i_0;
|
|
1918
|
+
}
|
|
1919
|
+
}
|
|
1920
|
+
function EdgeCube_1() {
|
|
1921
|
+
let i_0;
|
|
1922
|
+
let m_0;
|
|
1923
|
+
let t;
|
|
1924
|
+
EdgeCube_0.call(this);
|
|
1925
|
+
for (i_0 = 0; i_0 < 23; ++i_0) {
|
|
1926
|
+
t = i_0 + randomUIntBelow(24 - i_0);
|
|
1927
|
+
if (t !== i_0) {
|
|
1928
|
+
m_0 = this.ep[i_0];
|
|
1929
|
+
this.ep[i_0] = this.ep[t];
|
|
1930
|
+
this.ep[t] = m_0;
|
|
1931
|
+
}
|
|
1932
|
+
}
|
|
1933
|
+
}
|
|
1934
|
+
defineSeed(159, 1, {}, EdgeCube_0, EdgeCube_1);
|
|
1935
|
+
var ran$clinit_FullCube_0 = false;
|
|
1936
|
+
function $clinit_FullCube_0() {
|
|
1937
|
+
if (ran$clinit_FullCube_0) {
|
|
1938
|
+
return;
|
|
1939
|
+
}
|
|
1940
|
+
ran$clinit_FullCube_0 = true;
|
|
1941
|
+
move2rot = [35, 1, 34, 2, 4, 6, 22, 5, 19];
|
|
1942
|
+
}
|
|
1943
|
+
function $$init_3(this$static) {
|
|
1944
|
+
this$static.moveBuffer = createArray(60);
|
|
1945
|
+
}
|
|
1946
|
+
function $compareTo_1(this$static, c) {
|
|
1947
|
+
return this$static.value - c.value;
|
|
1948
|
+
}
|
|
1949
|
+
function $copy_4(this$static, c) {
|
|
1950
|
+
let i_0;
|
|
1951
|
+
$copy_3(this$static.edge, c.edge);
|
|
1952
|
+
$copy_1(this$static.center, c.center);
|
|
1953
|
+
$copy_2(this$static.corner, c.corner);
|
|
1954
|
+
this$static.value = c.value;
|
|
1955
|
+
this$static.add1 = c.add1;
|
|
1956
|
+
this$static.length1 = c.length1;
|
|
1957
|
+
this$static.length2 = c.length2;
|
|
1958
|
+
this$static.length3 = c.length3;
|
|
1959
|
+
this$static.sym = c.sym;
|
|
1960
|
+
for (i_0 = 0; i_0 < 60; ++i_0) {
|
|
1961
|
+
this$static.moveBuffer[i_0] = c.moveBuffer[i_0];
|
|
1962
|
+
}
|
|
1963
|
+
this$static.moveLength = c.moveLength;
|
|
1964
|
+
this$static.edgeAvail = c.edgeAvail;
|
|
1965
|
+
this$static.centerAvail = c.centerAvail;
|
|
1966
|
+
this$static.cornerAvail = c.cornerAvail;
|
|
1967
|
+
}
|
|
1968
|
+
function $getCenter(this$static) {
|
|
1969
|
+
while (this$static.centerAvail < this$static.moveLength) {
|
|
1970
|
+
$move_2(
|
|
1971
|
+
this$static.center,
|
|
1972
|
+
this$static.moveBuffer[this$static.centerAvail++]
|
|
1973
|
+
);
|
|
1974
|
+
}
|
|
1975
|
+
return this$static.center;
|
|
1976
|
+
}
|
|
1977
|
+
function $getCorner(this$static) {
|
|
1978
|
+
while (this$static.cornerAvail < this$static.moveLength) {
|
|
1979
|
+
$move_3(
|
|
1980
|
+
this$static.corner,
|
|
1981
|
+
this$static.moveBuffer[this$static.cornerAvail++] % 18
|
|
1982
|
+
);
|
|
1983
|
+
}
|
|
1984
|
+
return this$static.corner;
|
|
1985
|
+
}
|
|
1986
|
+
function $getEdge(this$static) {
|
|
1987
|
+
while (this$static.edgeAvail < this$static.moveLength) {
|
|
1988
|
+
$move_5(this$static.edge, this$static.moveBuffer[this$static.edgeAvail++]);
|
|
1989
|
+
}
|
|
1990
|
+
return this$static.edge;
|
|
1991
|
+
}
|
|
1992
|
+
function $getMoveString(this$static) {
|
|
1993
|
+
let i_0;
|
|
1994
|
+
let idx;
|
|
1995
|
+
let move;
|
|
1996
|
+
let rot;
|
|
1997
|
+
let sb;
|
|
1998
|
+
let sym;
|
|
1999
|
+
const fixedMoves = new Array(
|
|
2000
|
+
this$static.moveLength - (this$static.add1 ? 2 : 0)
|
|
2001
|
+
);
|
|
2002
|
+
idx = 0;
|
|
2003
|
+
for (i_0 = 0; i_0 < this$static.length1; ++i_0) {
|
|
2004
|
+
fixedMoves[idx++] = this$static.moveBuffer[i_0];
|
|
2005
|
+
}
|
|
2006
|
+
sym = this$static.sym;
|
|
2007
|
+
for (i_0 = this$static.length1 + (this$static.add1 ? 2 : 0); i_0 < this$static.moveLength; ++i_0) {
|
|
2008
|
+
if (symmove[sym][this$static.moveBuffer[i_0]] >= 27) {
|
|
2009
|
+
fixedMoves[idx++] = symmove[sym][this$static.moveBuffer[i_0]] - 9;
|
|
2010
|
+
rot = move2rot[symmove[sym][this$static.moveBuffer[i_0]] - 27];
|
|
2011
|
+
sym = symmult[sym][rot];
|
|
2012
|
+
} else {
|
|
2013
|
+
fixedMoves[idx++] = symmove[sym][this$static.moveBuffer[i_0]];
|
|
2014
|
+
}
|
|
2015
|
+
}
|
|
2016
|
+
const finishSym = symmult[syminv[sym]][getSolvedSym($getCenter(this$static))];
|
|
2017
|
+
sb = "";
|
|
2018
|
+
sym = finishSym;
|
|
2019
|
+
for (i_0 = idx - 1; i_0 >= 0; --i_0) {
|
|
2020
|
+
move = fixedMoves[i_0];
|
|
2021
|
+
move = ~~(move / 3) * 3 + (2 - move % 3);
|
|
2022
|
+
if (symmove[sym][move] >= 27) {
|
|
2023
|
+
sb = `${sb}${move2str_1[symmove[sym][move] - 9]} `;
|
|
2024
|
+
rot = move2rot[symmove[sym][move] - 27];
|
|
2025
|
+
sym = symmult[sym][rot];
|
|
2026
|
+
} else {
|
|
2027
|
+
sb = `${sb}${move2str_1[symmove[sym][move]]} `;
|
|
2028
|
+
}
|
|
2029
|
+
}
|
|
2030
|
+
return sb;
|
|
2031
|
+
}
|
|
2032
|
+
function $move_6(this$static, m_0) {
|
|
2033
|
+
this$static.moveBuffer[this$static.moveLength++] = m_0;
|
|
2034
|
+
return;
|
|
2035
|
+
}
|
|
2036
|
+
function FullCube_3() {
|
|
2037
|
+
$$init_3(this);
|
|
2038
|
+
this.edge = new EdgeCube_0();
|
|
2039
|
+
this.center = new CenterCube_0();
|
|
2040
|
+
this.corner = new CornerCube_0();
|
|
2041
|
+
}
|
|
2042
|
+
function FullCube_4(c) {
|
|
2043
|
+
FullCube_3.call(this);
|
|
2044
|
+
$copy_4(this, c);
|
|
2045
|
+
}
|
|
2046
|
+
function FullCube_5() {
|
|
2047
|
+
$$init_3(this);
|
|
2048
|
+
this.edge = new EdgeCube_1();
|
|
2049
|
+
this.center = new CenterCube_1();
|
|
2050
|
+
this.corner = new CornerCube_2();
|
|
2051
|
+
}
|
|
2052
|
+
defineSeed(
|
|
2053
|
+
160,
|
|
2054
|
+
1,
|
|
2055
|
+
makeCastMap([Q$FullCube_0, Q$Comparable]),
|
|
2056
|
+
FullCube_3,
|
|
2057
|
+
FullCube_4,
|
|
2058
|
+
FullCube_5
|
|
2059
|
+
);
|
|
2060
|
+
_.compareTo$ = function compareTo_1(c) {
|
|
2061
|
+
return $compareTo_1(this, c);
|
|
2062
|
+
};
|
|
2063
|
+
_.add1 = false;
|
|
2064
|
+
_.center = null;
|
|
2065
|
+
_.centerAvail = 0;
|
|
2066
|
+
_.corner = null;
|
|
2067
|
+
_.cornerAvail = 0;
|
|
2068
|
+
_.edge = null;
|
|
2069
|
+
_.edgeAvail = 0;
|
|
2070
|
+
_.length1 = 0;
|
|
2071
|
+
_.length2 = 0;
|
|
2072
|
+
_.length3 = 0;
|
|
2073
|
+
_.moveLength = 0;
|
|
2074
|
+
_.sym = 0;
|
|
2075
|
+
_.value = 0;
|
|
2076
|
+
var move2rot;
|
|
2077
|
+
function $compare(c1, c2) {
|
|
2078
|
+
return c2.value - c1.value;
|
|
2079
|
+
}
|
|
2080
|
+
function $compare_0(c1, c2) {
|
|
2081
|
+
return $compare(c1, c2);
|
|
2082
|
+
}
|
|
2083
|
+
function FullCube$ValueComparator_0() {
|
|
2084
|
+
}
|
|
2085
|
+
defineSeed(161, 1, {}, FullCube$ValueComparator_0);
|
|
2086
|
+
_.compare = function compare(c1, c2) {
|
|
2087
|
+
return $compare_0(c1, c2);
|
|
2088
|
+
};
|
|
2089
|
+
var ran$clinit_Moves = false;
|
|
2090
|
+
function $clinit_Moves() {
|
|
2091
|
+
if (ran$clinit_Moves) {
|
|
2092
|
+
return;
|
|
2093
|
+
}
|
|
2094
|
+
ran$clinit_Moves = true;
|
|
2095
|
+
let i_0;
|
|
2096
|
+
let j;
|
|
2097
|
+
move2str_1 = [
|
|
2098
|
+
"U ",
|
|
2099
|
+
"U2 ",
|
|
2100
|
+
"U' ",
|
|
2101
|
+
"R ",
|
|
2102
|
+
"R2 ",
|
|
2103
|
+
"R' ",
|
|
2104
|
+
"F ",
|
|
2105
|
+
"F2 ",
|
|
2106
|
+
"F' ",
|
|
2107
|
+
"D ",
|
|
2108
|
+
"D2 ",
|
|
2109
|
+
"D' ",
|
|
2110
|
+
"L ",
|
|
2111
|
+
"L2 ",
|
|
2112
|
+
"L' ",
|
|
2113
|
+
"B ",
|
|
2114
|
+
"B2 ",
|
|
2115
|
+
"B' ",
|
|
2116
|
+
"Uw ",
|
|
2117
|
+
"Uw2",
|
|
2118
|
+
"Uw'",
|
|
2119
|
+
"Rw ",
|
|
2120
|
+
"Rw2",
|
|
2121
|
+
"Rw'",
|
|
2122
|
+
"Fw ",
|
|
2123
|
+
"Fw2",
|
|
2124
|
+
"Fw'",
|
|
2125
|
+
"Dw ",
|
|
2126
|
+
"Dw2",
|
|
2127
|
+
"Dw'",
|
|
2128
|
+
"Lw ",
|
|
2129
|
+
"Lw2",
|
|
2130
|
+
"Lw'",
|
|
2131
|
+
"Bw ",
|
|
2132
|
+
"Bw2",
|
|
2133
|
+
"Bw'"
|
|
2134
|
+
];
|
|
2135
|
+
move2std = [
|
|
2136
|
+
0,
|
|
2137
|
+
1,
|
|
2138
|
+
2,
|
|
2139
|
+
3,
|
|
2140
|
+
4,
|
|
2141
|
+
5,
|
|
2142
|
+
6,
|
|
2143
|
+
7,
|
|
2144
|
+
8,
|
|
2145
|
+
9,
|
|
2146
|
+
10,
|
|
2147
|
+
11,
|
|
2148
|
+
12,
|
|
2149
|
+
13,
|
|
2150
|
+
14,
|
|
2151
|
+
15,
|
|
2152
|
+
16,
|
|
2153
|
+
17,
|
|
2154
|
+
19,
|
|
2155
|
+
21,
|
|
2156
|
+
22,
|
|
2157
|
+
23,
|
|
2158
|
+
25,
|
|
2159
|
+
28,
|
|
2160
|
+
30,
|
|
2161
|
+
31,
|
|
2162
|
+
32,
|
|
2163
|
+
34,
|
|
2164
|
+
36
|
|
2165
|
+
];
|
|
2166
|
+
move3std = [
|
|
2167
|
+
0,
|
|
2168
|
+
1,
|
|
2169
|
+
2,
|
|
2170
|
+
4,
|
|
2171
|
+
6,
|
|
2172
|
+
7,
|
|
2173
|
+
8,
|
|
2174
|
+
9,
|
|
2175
|
+
10,
|
|
2176
|
+
11,
|
|
2177
|
+
13,
|
|
2178
|
+
15,
|
|
2179
|
+
16,
|
|
2180
|
+
17,
|
|
2181
|
+
19,
|
|
2182
|
+
22,
|
|
2183
|
+
25,
|
|
2184
|
+
28,
|
|
2185
|
+
31,
|
|
2186
|
+
34,
|
|
2187
|
+
36
|
|
2188
|
+
];
|
|
2189
|
+
std2move = createArray(37);
|
|
2190
|
+
std3move = createArray(37);
|
|
2191
|
+
ckmv = createArray(37, 36);
|
|
2192
|
+
ckmv2_0 = createArray(29, 28);
|
|
2193
|
+
ckmv3 = createArray(21, 20);
|
|
2194
|
+
skipAxis = createArray(36);
|
|
2195
|
+
skipAxis2 = createArray(28);
|
|
2196
|
+
skipAxis3 = createArray(20);
|
|
2197
|
+
for (i_0 = 0; i_0 < 29; ++i_0) {
|
|
2198
|
+
std2move[move2std[i_0]] = i_0;
|
|
2199
|
+
}
|
|
2200
|
+
for (i_0 = 0; i_0 < 21; ++i_0) {
|
|
2201
|
+
std3move[move3std[i_0]] = i_0;
|
|
2202
|
+
}
|
|
2203
|
+
for (i_0 = 0; i_0 < 36; ++i_0) {
|
|
2204
|
+
for (j = 0; j < 36; ++j) {
|
|
2205
|
+
ckmv[i_0][j] = ~~(i_0 / 3) === ~~(j / 3) || ~~(i_0 / 3) % 3 === ~~(j / 3) % 3 && i_0 > j;
|
|
2206
|
+
}
|
|
2207
|
+
ckmv[36][i_0] = false;
|
|
2208
|
+
}
|
|
2209
|
+
for (i_0 = 0; i_0 < 29; ++i_0) {
|
|
2210
|
+
for (j = 0; j < 28; ++j) {
|
|
2211
|
+
ckmv2_0[i_0][j] = ckmv[move2std[i_0]][move2std[j]];
|
|
2212
|
+
}
|
|
2213
|
+
}
|
|
2214
|
+
for (i_0 = 0; i_0 < 21; ++i_0) {
|
|
2215
|
+
for (j = 0; j < 20; ++j) {
|
|
2216
|
+
ckmv3[i_0][j] = ckmv[move3std[i_0]][move3std[j]];
|
|
2217
|
+
}
|
|
2218
|
+
}
|
|
2219
|
+
for (i_0 = 0; i_0 < 36; ++i_0) {
|
|
2220
|
+
skipAxis[i_0] = 36;
|
|
2221
|
+
for (j = i_0; j < 36; ++j) {
|
|
2222
|
+
if (!ckmv[i_0][j]) {
|
|
2223
|
+
skipAxis[i_0] = j - 1;
|
|
2224
|
+
break;
|
|
2225
|
+
}
|
|
2226
|
+
}
|
|
2227
|
+
}
|
|
2228
|
+
for (i_0 = 0; i_0 < 28; ++i_0) {
|
|
2229
|
+
skipAxis2[i_0] = 28;
|
|
2230
|
+
for (j = i_0; j < 28; ++j) {
|
|
2231
|
+
if (!ckmv2_0[i_0][j]) {
|
|
2232
|
+
skipAxis2[i_0] = j - 1;
|
|
2233
|
+
break;
|
|
2234
|
+
}
|
|
2235
|
+
}
|
|
2236
|
+
}
|
|
2237
|
+
for (i_0 = 0; i_0 < 20; ++i_0) {
|
|
2238
|
+
skipAxis3[i_0] = 20;
|
|
2239
|
+
for (j = i_0; j < 20; ++j) {
|
|
2240
|
+
if (!ckmv3[i_0][j]) {
|
|
2241
|
+
skipAxis3[i_0] = j - 1;
|
|
2242
|
+
break;
|
|
2243
|
+
}
|
|
2244
|
+
}
|
|
2245
|
+
}
|
|
2246
|
+
}
|
|
2247
|
+
var ckmv;
|
|
2248
|
+
var ckmv2_0;
|
|
2249
|
+
var ckmv3;
|
|
2250
|
+
var move2std;
|
|
2251
|
+
var move2str_1;
|
|
2252
|
+
var move3std;
|
|
2253
|
+
var skipAxis;
|
|
2254
|
+
var skipAxis2;
|
|
2255
|
+
var skipAxis3;
|
|
2256
|
+
var std2move;
|
|
2257
|
+
var std3move;
|
|
2258
|
+
function $doSearch(this$static) {
|
|
2259
|
+
let MAX_LENGTH2;
|
|
2260
|
+
let MAX_LENGTH3;
|
|
2261
|
+
let ct;
|
|
2262
|
+
let edge;
|
|
2263
|
+
let eparity;
|
|
2264
|
+
let i_0;
|
|
2265
|
+
let index;
|
|
2266
|
+
let length12;
|
|
2267
|
+
let length123;
|
|
2268
|
+
let prun;
|
|
2269
|
+
let s2ct;
|
|
2270
|
+
let s2rl;
|
|
2271
|
+
this$static.solution = "";
|
|
2272
|
+
const ud = $getsym(new Center1_1($getCenter(this$static.c), 0));
|
|
2273
|
+
const fb = $getsym(new Center1_1($getCenter(this$static.c), 1));
|
|
2274
|
+
const rl = $getsym(new Center1_1($getCenter(this$static.c), 2));
|
|
2275
|
+
const udprun = csprun[~~ud >> 6];
|
|
2276
|
+
const fbprun = csprun[~~fb >> 6];
|
|
2277
|
+
const rlprun = csprun[~~rl >> 6];
|
|
2278
|
+
this$static.p1SolsCnt = 0;
|
|
2279
|
+
this$static.arr2idx = 0;
|
|
2280
|
+
$clear(this$static.p1sols.heap);
|
|
2281
|
+
for (this$static.length1 = (udprun < fbprun ? udprun : fbprun) < rlprun ? udprun < fbprun ? udprun : fbprun : rlprun; this$static.length1 < 100; ++this$static.length1) {
|
|
2282
|
+
if (rlprun <= this$static.length1 && $search1(
|
|
2283
|
+
this$static,
|
|
2284
|
+
~~rl >>> 6,
|
|
2285
|
+
rl & 63,
|
|
2286
|
+
this$static.length1,
|
|
2287
|
+
-1,
|
|
2288
|
+
0
|
|
2289
|
+
) || udprun <= this$static.length1 && $search1(
|
|
2290
|
+
this$static,
|
|
2291
|
+
~~ud >>> 6,
|
|
2292
|
+
ud & 63,
|
|
2293
|
+
this$static.length1,
|
|
2294
|
+
-1,
|
|
2295
|
+
0
|
|
2296
|
+
) || fbprun <= this$static.length1 && $search1(this$static, ~~fb >>> 6, fb & 63, this$static.length1, -1, 0)) {
|
|
2297
|
+
break;
|
|
2298
|
+
}
|
|
2299
|
+
}
|
|
2300
|
+
const p1SolsArr = $toArray_1(
|
|
2301
|
+
this$static.p1sols,
|
|
2302
|
+
initDim(
|
|
2303
|
+
_3Lcs_threephase_FullCube_2_classLit,
|
|
2304
|
+
makeCastMap([Q$FullCube_$1, Q$Serializable, Q$Object_$1]),
|
|
2305
|
+
Q$FullCube_0,
|
|
2306
|
+
0,
|
|
2307
|
+
0
|
|
2308
|
+
)
|
|
2309
|
+
);
|
|
2310
|
+
p1SolsArr.sort(function(a, b) {
|
|
2311
|
+
return a.value - b.value;
|
|
2312
|
+
});
|
|
2313
|
+
MAX_LENGTH2 = 9;
|
|
2314
|
+
do {
|
|
2315
|
+
OUT: for (length12 = p1SolsArr[0].value; length12 < 100; ++length12) {
|
|
2316
|
+
for (i_0 = 0; i_0 < p1SolsArr.length; ++i_0) {
|
|
2317
|
+
if (p1SolsArr[i_0].value > length12) {
|
|
2318
|
+
break;
|
|
2319
|
+
}
|
|
2320
|
+
if (length12 - p1SolsArr[i_0].length1 > MAX_LENGTH2) {
|
|
2321
|
+
continue;
|
|
2322
|
+
}
|
|
2323
|
+
$copy_4(this$static.c1, p1SolsArr[i_0]);
|
|
2324
|
+
$set_2(
|
|
2325
|
+
this$static.ct2,
|
|
2326
|
+
$getCenter(this$static.c1),
|
|
2327
|
+
parity_0($getEdge(this$static.c1).ep)
|
|
2328
|
+
);
|
|
2329
|
+
s2ct = $getct(this$static.ct2);
|
|
2330
|
+
s2rl = $getrl(this$static.ct2);
|
|
2331
|
+
this$static.length1 = p1SolsArr[i_0].length1;
|
|
2332
|
+
this$static.length2 = length12 - p1SolsArr[i_0].length1;
|
|
2333
|
+
if ($search2(this$static, s2ct, s2rl, this$static.length2, 28, 0)) {
|
|
2334
|
+
break OUT;
|
|
2335
|
+
}
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2338
|
+
++MAX_LENGTH2;
|
|
2339
|
+
} while (length12 === 100);
|
|
2340
|
+
this$static.arr2.sort(function(a, b) {
|
|
2341
|
+
return a.value - b.value;
|
|
2342
|
+
});
|
|
2343
|
+
index = 0;
|
|
2344
|
+
MAX_LENGTH3 = 13;
|
|
2345
|
+
do {
|
|
2346
|
+
OUT2: for (length123 = this$static.arr2[0].value; length123 < 100; ++length123) {
|
|
2347
|
+
for (i_0 = 0; i_0 < Math.min(this$static.arr2idx, 100); ++i_0) {
|
|
2348
|
+
if (this$static.arr2[i_0].value > length123) {
|
|
2349
|
+
break;
|
|
2350
|
+
}
|
|
2351
|
+
if (length123 - this$static.arr2[i_0].length1 - this$static.arr2[i_0].length2 > MAX_LENGTH3) {
|
|
2352
|
+
continue;
|
|
2353
|
+
}
|
|
2354
|
+
eparity = $set_6(this$static.e12, $getEdge(this$static.arr2[i_0]));
|
|
2355
|
+
$set_3(
|
|
2356
|
+
this$static.ct3,
|
|
2357
|
+
$getCenter(this$static.arr2[i_0]),
|
|
2358
|
+
eparity ^ parity_0($getCorner(this$static.arr2[i_0]).cp)
|
|
2359
|
+
);
|
|
2360
|
+
ct = $getct_0(this$static.ct3);
|
|
2361
|
+
edge = $get_2(this$static.e12, 10);
|
|
2362
|
+
prun = getprun($getsym_0(this$static.e12));
|
|
2363
|
+
if (prun <= length123 - this$static.arr2[i_0].length1 - this$static.arr2[i_0].length2 && $search3(
|
|
2364
|
+
this$static,
|
|
2365
|
+
edge,
|
|
2366
|
+
ct,
|
|
2367
|
+
prun,
|
|
2368
|
+
length123 - this$static.arr2[i_0].length1 - this$static.arr2[i_0].length2,
|
|
2369
|
+
20,
|
|
2370
|
+
0
|
|
2371
|
+
)) {
|
|
2372
|
+
index = i_0;
|
|
2373
|
+
break OUT2;
|
|
2374
|
+
}
|
|
2375
|
+
}
|
|
2376
|
+
}
|
|
2377
|
+
++MAX_LENGTH3;
|
|
2378
|
+
} while (length123 === 100);
|
|
2379
|
+
const solcube = new FullCube_4(this$static.arr2[index]);
|
|
2380
|
+
this$static.length1 = solcube.length1;
|
|
2381
|
+
this$static.length2 = solcube.length2;
|
|
2382
|
+
const length_0 = length123 - this$static.length1 - this$static.length2;
|
|
2383
|
+
for (i_0 = 0; i_0 < length_0; ++i_0) {
|
|
2384
|
+
$move_6(solcube, move3std[this$static.move3[i_0]]);
|
|
2385
|
+
}
|
|
2386
|
+
this$static.solution = $getMoveString(solcube);
|
|
2387
|
+
}
|
|
2388
|
+
function $init2_0(this$static, sym) {
|
|
2389
|
+
let i_0;
|
|
2390
|
+
let next;
|
|
2391
|
+
$copy_4(this$static.c1, this$static.c);
|
|
2392
|
+
for (i_0 = 0; i_0 < this$static.length1; ++i_0) {
|
|
2393
|
+
$move_6(this$static.c1, this$static.move1[i_0]);
|
|
2394
|
+
}
|
|
2395
|
+
switch (finish_0[sym]) {
|
|
2396
|
+
case 0: {
|
|
2397
|
+
$move_6(this$static.c1, 24);
|
|
2398
|
+
$move_6(this$static.c1, 35);
|
|
2399
|
+
this$static.move1[this$static.length1] = 24;
|
|
2400
|
+
this$static.move1[this$static.length1 + 1] = 35;
|
|
2401
|
+
this$static.add1 = true;
|
|
2402
|
+
sym = 19;
|
|
2403
|
+
break;
|
|
2404
|
+
}
|
|
2405
|
+
case 12869: {
|
|
2406
|
+
$move_6(this$static.c1, 18);
|
|
2407
|
+
$move_6(this$static.c1, 29);
|
|
2408
|
+
this$static.move1[this$static.length1] = 18;
|
|
2409
|
+
this$static.move1[this$static.length1 + 1] = 29;
|
|
2410
|
+
this$static.add1 = true;
|
|
2411
|
+
sym = 34;
|
|
2412
|
+
break;
|
|
2413
|
+
}
|
|
2414
|
+
case 735470: {
|
|
2415
|
+
this$static.add1 = false;
|
|
2416
|
+
sym = 0;
|
|
2417
|
+
}
|
|
2418
|
+
}
|
|
2419
|
+
$set_2(
|
|
2420
|
+
this$static.ct2,
|
|
2421
|
+
$getCenter(this$static.c1),
|
|
2422
|
+
parity_0($getEdge(this$static.c1).ep)
|
|
2423
|
+
);
|
|
2424
|
+
const s2ct = $getct(this$static.ct2);
|
|
2425
|
+
const s2rl = $getrl(this$static.ct2);
|
|
2426
|
+
const ctp = ctprun[s2ct * 70 + s2rl];
|
|
2427
|
+
this$static.c1.value = ctp + this$static.length1;
|
|
2428
|
+
this$static.c1.length1 = this$static.length1;
|
|
2429
|
+
this$static.c1.add1 = this$static.add1;
|
|
2430
|
+
this$static.c1.sym = sym;
|
|
2431
|
+
++this$static.p1SolsCnt;
|
|
2432
|
+
if (this$static.p1sols.heap.size < 500) {
|
|
2433
|
+
next = new FullCube_4(this$static.c1);
|
|
2434
|
+
} else {
|
|
2435
|
+
next = $poll(this$static.p1sols);
|
|
2436
|
+
next.value > this$static.c1.value && $copy_4(next, this$static.c1);
|
|
2437
|
+
}
|
|
2438
|
+
$add(this$static.p1sols, next);
|
|
2439
|
+
return this$static.p1SolsCnt === 1e4;
|
|
2440
|
+
}
|
|
2441
|
+
function $init3(this$static) {
|
|
2442
|
+
let i_0;
|
|
2443
|
+
$copy_4(this$static.c2, this$static.c1);
|
|
2444
|
+
for (i_0 = 0; i_0 < this$static.length2; ++i_0) {
|
|
2445
|
+
$move_6(this$static.c2, this$static.move2[i_0]);
|
|
2446
|
+
}
|
|
2447
|
+
if (!$checkEdge($getEdge(this$static.c2))) {
|
|
2448
|
+
return false;
|
|
2449
|
+
}
|
|
2450
|
+
const eparity = $set_6(this$static.e12, $getEdge(this$static.c2));
|
|
2451
|
+
$set_3(
|
|
2452
|
+
this$static.ct3,
|
|
2453
|
+
$getCenter(this$static.c2),
|
|
2454
|
+
eparity ^ parity_0($getCorner(this$static.c2).cp)
|
|
2455
|
+
);
|
|
2456
|
+
const ct = $getct_0(this$static.ct3);
|
|
2457
|
+
$get_2(this$static.e12, 10);
|
|
2458
|
+
const prun = getprun($getsym_0(this$static.e12));
|
|
2459
|
+
!this$static.arr2[this$static.arr2idx] ? this$static.arr2[this$static.arr2idx] = new FullCube_4(this$static.c2) : $copy_4(this$static.arr2[this$static.arr2idx], this$static.c2);
|
|
2460
|
+
this$static.arr2[this$static.arr2idx].value = this$static.length1 + this$static.length2 + Math.max(prun, prun_0[ct]);
|
|
2461
|
+
this$static.arr2[this$static.arr2idx].length2 = this$static.length2;
|
|
2462
|
+
++this$static.arr2idx;
|
|
2463
|
+
return this$static.arr2idx === this$static.arr2.length;
|
|
2464
|
+
}
|
|
2465
|
+
function $randomState(this$static) {
|
|
2466
|
+
init_5();
|
|
2467
|
+
this$static.c = new FullCube_5();
|
|
2468
|
+
$doSearch(this$static);
|
|
2469
|
+
return this$static.solution;
|
|
2470
|
+
}
|
|
2471
|
+
function $search1(this$static, ct, sym, maxl, lm, depth) {
|
|
2472
|
+
let axis;
|
|
2473
|
+
let ctx;
|
|
2474
|
+
let m_0;
|
|
2475
|
+
let power;
|
|
2476
|
+
let prun;
|
|
2477
|
+
let symx;
|
|
2478
|
+
if (ct === 0) {
|
|
2479
|
+
return maxl === 0 && $init2_0(this$static, sym);
|
|
2480
|
+
}
|
|
2481
|
+
for (axis = 0; axis < 27; axis += 3) {
|
|
2482
|
+
if (axis === lm || axis === lm - 9 || axis === lm - 18) {
|
|
2483
|
+
continue;
|
|
2484
|
+
}
|
|
2485
|
+
for (power = 0; power < 3; ++power) {
|
|
2486
|
+
m_0 = axis + power;
|
|
2487
|
+
ctx = ctsmv[ct][symmove[sym][m_0]];
|
|
2488
|
+
prun = csprun[~~ctx >>> 6];
|
|
2489
|
+
if (prun >= maxl) {
|
|
2490
|
+
if (prun > maxl) {
|
|
2491
|
+
break;
|
|
2492
|
+
}
|
|
2493
|
+
continue;
|
|
2494
|
+
}
|
|
2495
|
+
symx = symmult[sym][ctx & 63];
|
|
2496
|
+
ctx >>>= 6;
|
|
2497
|
+
this$static.move1[depth] = m_0;
|
|
2498
|
+
if ($search1(this$static, ctx, symx, maxl - 1, axis, depth + 1)) {
|
|
2499
|
+
return true;
|
|
2500
|
+
}
|
|
2501
|
+
}
|
|
2502
|
+
}
|
|
2503
|
+
return false;
|
|
2504
|
+
}
|
|
2505
|
+
function $search2(this$static, ct, rl, maxl, lm, depth) {
|
|
2506
|
+
let ctx;
|
|
2507
|
+
let m_0;
|
|
2508
|
+
let prun;
|
|
2509
|
+
let rlx;
|
|
2510
|
+
if (ct === 0 && ctprun[rl] === 0) {
|
|
2511
|
+
return maxl === 0 && $init3(this$static);
|
|
2512
|
+
}
|
|
2513
|
+
for (m_0 = 0; m_0 < 23; ++m_0) {
|
|
2514
|
+
if (ckmv2_0[lm][m_0]) {
|
|
2515
|
+
m_0 = skipAxis2[m_0];
|
|
2516
|
+
continue;
|
|
2517
|
+
}
|
|
2518
|
+
ctx = ctmv[ct][m_0];
|
|
2519
|
+
rlx = rlmv[rl][m_0];
|
|
2520
|
+
prun = ctprun[ctx * 70 + rlx];
|
|
2521
|
+
if (prun >= maxl) {
|
|
2522
|
+
prun > maxl && (m_0 = skipAxis2[m_0]);
|
|
2523
|
+
continue;
|
|
2524
|
+
}
|
|
2525
|
+
this$static.move2[depth] = move2std[m_0];
|
|
2526
|
+
if ($search2(this$static, ctx, rlx, maxl - 1, m_0, depth + 1)) {
|
|
2527
|
+
return true;
|
|
2528
|
+
}
|
|
2529
|
+
}
|
|
2530
|
+
return false;
|
|
2531
|
+
}
|
|
2532
|
+
function $search3(this$static, edge, ct, prun, maxl, lm, depth) {
|
|
2533
|
+
let cord1x;
|
|
2534
|
+
let cord2x;
|
|
2535
|
+
let ctx;
|
|
2536
|
+
let edgex;
|
|
2537
|
+
let m_0;
|
|
2538
|
+
let prun1;
|
|
2539
|
+
let prunx;
|
|
2540
|
+
let symcord1x;
|
|
2541
|
+
let symx;
|
|
2542
|
+
if (maxl === 0) {
|
|
2543
|
+
return edge === 0 && ct === 0;
|
|
2544
|
+
}
|
|
2545
|
+
$set_4(this$static.tempe[depth], edge);
|
|
2546
|
+
for (m_0 = 0; m_0 < 17; ++m_0) {
|
|
2547
|
+
if (ckmv3[lm][m_0]) {
|
|
2548
|
+
m_0 = skipAxis3[m_0];
|
|
2549
|
+
continue;
|
|
2550
|
+
}
|
|
2551
|
+
ctx = ctmove[ct][m_0];
|
|
2552
|
+
prun1 = prun_0[ctx];
|
|
2553
|
+
if (prun1 >= maxl) {
|
|
2554
|
+
prun1 > maxl && m_0 < 14 && (m_0 = skipAxis3[m_0]);
|
|
2555
|
+
continue;
|
|
2556
|
+
}
|
|
2557
|
+
edgex = getmvrot(this$static.tempe[depth].edge, m_0 << 3, 10);
|
|
2558
|
+
cord1x = ~~(edgex / 20160);
|
|
2559
|
+
symcord1x = raw2sym_1[cord1x];
|
|
2560
|
+
symx = symcord1x & 7;
|
|
2561
|
+
symcord1x >>= 3;
|
|
2562
|
+
cord2x = getmvrot(this$static.tempe[depth].edge, m_0 << 3 | symx, 10) % 20160;
|
|
2563
|
+
prunx = getprun_0(symcord1x * 20160 + cord2x, prun);
|
|
2564
|
+
if (prunx >= maxl) {
|
|
2565
|
+
prunx > maxl && m_0 < 14 && (m_0 = skipAxis3[m_0]);
|
|
2566
|
+
continue;
|
|
2567
|
+
}
|
|
2568
|
+
if ($search3(this$static, edgex, ctx, prunx, maxl - 1, m_0, depth + 1)) {
|
|
2569
|
+
this$static.move3[depth] = m_0;
|
|
2570
|
+
return true;
|
|
2571
|
+
}
|
|
2572
|
+
}
|
|
2573
|
+
return false;
|
|
2574
|
+
}
|
|
2575
|
+
function Search_4() {
|
|
2576
|
+
let i_0;
|
|
2577
|
+
this.p1sols = new PriorityQueue_0(new FullCube$ValueComparator_0());
|
|
2578
|
+
this.move1 = createArray(15);
|
|
2579
|
+
this.move2 = createArray(20);
|
|
2580
|
+
this.move3 = createArray(20);
|
|
2581
|
+
this.c1 = new FullCube_3();
|
|
2582
|
+
this.c2 = new FullCube_3();
|
|
2583
|
+
this.ct2 = new Center2_0();
|
|
2584
|
+
this.ct3 = new Center3_0();
|
|
2585
|
+
this.e12 = new Edge3_0();
|
|
2586
|
+
this.tempe = createArray(20);
|
|
2587
|
+
this.arr2 = createArray(100);
|
|
2588
|
+
for (i_0 = 0; i_0 < 20; ++i_0) {
|
|
2589
|
+
this.tempe[i_0] = new Edge3_0();
|
|
2590
|
+
}
|
|
2591
|
+
}
|
|
2592
|
+
function init_5() {
|
|
2593
|
+
if (inited_2) {
|
|
2594
|
+
return;
|
|
2595
|
+
}
|
|
2596
|
+
initSym_0();
|
|
2597
|
+
raw2sym = createArray(735471);
|
|
2598
|
+
initSym2Raw();
|
|
2599
|
+
createMoveTable();
|
|
2600
|
+
raw2sym = null;
|
|
2601
|
+
createPrun();
|
|
2602
|
+
init_3();
|
|
2603
|
+
init_4();
|
|
2604
|
+
initMvrot();
|
|
2605
|
+
initRaw2Sym();
|
|
2606
|
+
createPrun_0();
|
|
2607
|
+
inited_2 = true;
|
|
2608
|
+
}
|
|
2609
|
+
defineSeed(163, 1, makeCastMap([Q$Search_0]), Search_4);
|
|
2610
|
+
_.add1 = false;
|
|
2611
|
+
_.arr2idx = 0;
|
|
2612
|
+
_.c = null;
|
|
2613
|
+
_.length1 = 0;
|
|
2614
|
+
_.length2 = 0;
|
|
2615
|
+
_.p1SolsCnt = 0;
|
|
2616
|
+
_.solution = "";
|
|
2617
|
+
var inited_2 = false;
|
|
2618
|
+
var ran$clinit_Util_0 = false;
|
|
2619
|
+
function $clinit_Util_0() {
|
|
2620
|
+
if (ran$clinit_Util_0) {
|
|
2621
|
+
return;
|
|
2622
|
+
}
|
|
2623
|
+
ran$clinit_Util_0 = true;
|
|
2624
|
+
}
|
|
2625
|
+
function parity_0(arr) {
|
|
2626
|
+
let i_0;
|
|
2627
|
+
let j;
|
|
2628
|
+
let len;
|
|
2629
|
+
let parity;
|
|
2630
|
+
parity = 0;
|
|
2631
|
+
for (i_0 = 0, len = arr.length; i_0 < len; ++i_0) {
|
|
2632
|
+
for (j = i_0; j < len; ++j) {
|
|
2633
|
+
arr[i_0] > arr[j] && (parity ^= 1);
|
|
2634
|
+
}
|
|
2635
|
+
}
|
|
2636
|
+
return parity;
|
|
2637
|
+
}
|
|
2638
|
+
function swap(arr, a, b, c, d, key) {
|
|
2639
|
+
let temp;
|
|
2640
|
+
switch (key) {
|
|
2641
|
+
case 0: {
|
|
2642
|
+
temp = arr[d];
|
|
2643
|
+
arr[d] = arr[c];
|
|
2644
|
+
arr[c] = arr[b];
|
|
2645
|
+
arr[b] = arr[a];
|
|
2646
|
+
arr[a] = temp;
|
|
2647
|
+
return;
|
|
2648
|
+
}
|
|
2649
|
+
case 1: {
|
|
2650
|
+
temp = arr[a];
|
|
2651
|
+
arr[a] = arr[c];
|
|
2652
|
+
arr[c] = temp;
|
|
2653
|
+
temp = arr[b];
|
|
2654
|
+
arr[b] = arr[d];
|
|
2655
|
+
arr[d] = temp;
|
|
2656
|
+
return;
|
|
2657
|
+
}
|
|
2658
|
+
case 2: {
|
|
2659
|
+
temp = arr[a];
|
|
2660
|
+
arr[a] = arr[b];
|
|
2661
|
+
arr[b] = arr[c];
|
|
2662
|
+
arr[c] = arr[d];
|
|
2663
|
+
arr[d] = temp;
|
|
2664
|
+
return;
|
|
2665
|
+
}
|
|
2666
|
+
}
|
|
2667
|
+
}
|
|
2668
|
+
function Class_0() {
|
|
2669
|
+
}
|
|
2670
|
+
function createForArray(packageName, className, seedId, componentType) {
|
|
2671
|
+
const clazz = new Class_0();
|
|
2672
|
+
clazz.typeName = packageName + className;
|
|
2673
|
+
isInstantiable(seedId !== 0 ? -seedId : 0) && setClassLiteral(seedId !== 0 ? -seedId : 0, clazz);
|
|
2674
|
+
clazz.modifiers = 4;
|
|
2675
|
+
clazz.superclass = Ljava_lang_Object_2_classLit;
|
|
2676
|
+
clazz.componentType = componentType;
|
|
2677
|
+
return clazz;
|
|
2678
|
+
}
|
|
2679
|
+
function createForClass(packageName, className, seedId, superclass) {
|
|
2680
|
+
const clazz = new Class_0();
|
|
2681
|
+
clazz.typeName = packageName + className;
|
|
2682
|
+
isInstantiable(seedId) && setClassLiteral(seedId, clazz);
|
|
2683
|
+
clazz.superclass = superclass;
|
|
2684
|
+
return clazz;
|
|
2685
|
+
}
|
|
2686
|
+
function getSeedFunction(clazz) {
|
|
2687
|
+
const func = seedTable[clazz.seedId];
|
|
2688
|
+
clazz = null;
|
|
2689
|
+
return func;
|
|
2690
|
+
}
|
|
2691
|
+
function isInstantiable(seedId) {
|
|
2692
|
+
return typeof seedId === "number" && seedId > 0;
|
|
2693
|
+
}
|
|
2694
|
+
function setClassLiteral(seedId, clazz) {
|
|
2695
|
+
let proto;
|
|
2696
|
+
clazz.seedId = seedId;
|
|
2697
|
+
if (seedId === 2) {
|
|
2698
|
+
proto = String.prototype;
|
|
2699
|
+
} else {
|
|
2700
|
+
if (seedId > 0) {
|
|
2701
|
+
let seed = getSeedFunction(clazz);
|
|
2702
|
+
if (seed) {
|
|
2703
|
+
proto = seed.prototype;
|
|
2704
|
+
} else {
|
|
2705
|
+
seed = seedTable[seedId] = function() {
|
|
2706
|
+
};
|
|
2707
|
+
seed.___clazz$ = clazz;
|
|
2708
|
+
return;
|
|
2709
|
+
}
|
|
2710
|
+
} else {
|
|
2711
|
+
return;
|
|
2712
|
+
}
|
|
2713
|
+
}
|
|
2714
|
+
proto.___clazz$ = clazz;
|
|
2715
|
+
}
|
|
2716
|
+
_.val$outerIter = null;
|
|
2717
|
+
function $add(this$static, o) {
|
|
2718
|
+
if ($offer(this$static, o)) {
|
|
2719
|
+
return true;
|
|
2720
|
+
}
|
|
2721
|
+
}
|
|
2722
|
+
function $$init_6(this$static) {
|
|
2723
|
+
this$static.array = initDim(
|
|
2724
|
+
_3Ljava_lang_Object_2_classLit,
|
|
2725
|
+
makeCastMap([Q$Serializable, Q$Object_$1]),
|
|
2726
|
+
Q$Object,
|
|
2727
|
+
0,
|
|
2728
|
+
0
|
|
2729
|
+
);
|
|
2730
|
+
}
|
|
2731
|
+
function $add_0(this$static, o) {
|
|
2732
|
+
setCheck(this$static.array, this$static.size++, o);
|
|
2733
|
+
return true;
|
|
2734
|
+
}
|
|
2735
|
+
function $clear(this$static) {
|
|
2736
|
+
this$static.array = initDim(
|
|
2737
|
+
_3Ljava_lang_Object_2_classLit,
|
|
2738
|
+
makeCastMap([Q$Serializable, Q$Object_$1]),
|
|
2739
|
+
Q$Object,
|
|
2740
|
+
0,
|
|
2741
|
+
0
|
|
2742
|
+
);
|
|
2743
|
+
this$static.size = 0;
|
|
2744
|
+
}
|
|
2745
|
+
function $get_4(this$static, index) {
|
|
2746
|
+
return this$static.array[index];
|
|
2747
|
+
}
|
|
2748
|
+
function $remove_0(this$static, index) {
|
|
2749
|
+
const previous = this$static.array[index];
|
|
2750
|
+
splice_0(this$static.array, index, 1);
|
|
2751
|
+
--this$static.size;
|
|
2752
|
+
return previous;
|
|
2753
|
+
}
|
|
2754
|
+
function $set_7(this$static, index, o) {
|
|
2755
|
+
const previous = this$static.array[index];
|
|
2756
|
+
setCheck(this$static.array, index, o);
|
|
2757
|
+
return previous;
|
|
2758
|
+
}
|
|
2759
|
+
function $toArray_0(this$static, out) {
|
|
2760
|
+
let i_0;
|
|
2761
|
+
out.length < this$static.size && (out = createFrom(out, this$static.size));
|
|
2762
|
+
for (i_0 = 0; i_0 < this$static.size; ++i_0) {
|
|
2763
|
+
setCheck(out, i_0, this$static.array[i_0]);
|
|
2764
|
+
}
|
|
2765
|
+
out.length > this$static.size && setCheck(out, this$static.size, null);
|
|
2766
|
+
return out;
|
|
2767
|
+
}
|
|
2768
|
+
function ArrayList_1() {
|
|
2769
|
+
$$init_6(this);
|
|
2770
|
+
this.array.length = 500;
|
|
2771
|
+
}
|
|
2772
|
+
function splice_0(array, index, deleteCount) {
|
|
2773
|
+
array.splice(index, deleteCount);
|
|
2774
|
+
}
|
|
2775
|
+
_.size = 0;
|
|
2776
|
+
function binarySearch_0(sortedArray, key) {
|
|
2777
|
+
let high;
|
|
2778
|
+
let low;
|
|
2779
|
+
let mid;
|
|
2780
|
+
let midVal;
|
|
2781
|
+
low = 0;
|
|
2782
|
+
high = sortedArray.length - 1;
|
|
2783
|
+
while (low <= high) {
|
|
2784
|
+
mid = low + (~~(high - low) >> 1);
|
|
2785
|
+
midVal = sortedArray[mid];
|
|
2786
|
+
if (midVal < key) {
|
|
2787
|
+
low = mid + 1;
|
|
2788
|
+
} else if (midVal > key) {
|
|
2789
|
+
high = mid - 1;
|
|
2790
|
+
} else {
|
|
2791
|
+
return mid;
|
|
2792
|
+
}
|
|
2793
|
+
}
|
|
2794
|
+
return -low - 1;
|
|
2795
|
+
}
|
|
2796
|
+
function fill_0(a) {
|
|
2797
|
+
fill_1(a, a.length);
|
|
2798
|
+
}
|
|
2799
|
+
function fill_1(a, toIndex) {
|
|
2800
|
+
let i_0;
|
|
2801
|
+
for (i_0 = 0; i_0 < toIndex; ++i_0) {
|
|
2802
|
+
a[i_0] = -1;
|
|
2803
|
+
}
|
|
2804
|
+
}
|
|
2805
|
+
function $mergeHeaps(this$static, node) {
|
|
2806
|
+
let smallestChild;
|
|
2807
|
+
let leftChild;
|
|
2808
|
+
let rightChild;
|
|
2809
|
+
let smallestChild_0;
|
|
2810
|
+
const heapSize = this$static.heap.size;
|
|
2811
|
+
const value = $get_4(this$static.heap, node);
|
|
2812
|
+
while (node * 2 + 1 < heapSize) {
|
|
2813
|
+
smallestChild = (leftChild = 2 * node + 1, rightChild = leftChild + 1, smallestChild_0 = leftChild, rightChild < heapSize && $compare_0(
|
|
2814
|
+
$get_4(this$static.heap, rightChild),
|
|
2815
|
+
$get_4(this$static.heap, leftChild)
|
|
2816
|
+
) < 0 && (smallestChild_0 = rightChild), smallestChild_0);
|
|
2817
|
+
if ($compare_0(value, $get_4(this$static.heap, smallestChild)) < 0) {
|
|
2818
|
+
break;
|
|
2819
|
+
}
|
|
2820
|
+
$set_7(this$static.heap, node, $get_4(this$static.heap, smallestChild));
|
|
2821
|
+
node = smallestChild;
|
|
2822
|
+
}
|
|
2823
|
+
$set_7(this$static.heap, node, value);
|
|
2824
|
+
}
|
|
2825
|
+
function $offer(this$static, e) {
|
|
2826
|
+
let childNode;
|
|
2827
|
+
let node;
|
|
2828
|
+
node = this$static.heap.size;
|
|
2829
|
+
$add_0(this$static.heap, e);
|
|
2830
|
+
while (node > 0) {
|
|
2831
|
+
childNode = node;
|
|
2832
|
+
node = ~~((node - 1) / 2);
|
|
2833
|
+
if ($compare_0($get_4(this$static.heap, node), e) <= 0) {
|
|
2834
|
+
$set_7(this$static.heap, childNode, e);
|
|
2835
|
+
return true;
|
|
2836
|
+
}
|
|
2837
|
+
$set_7(this$static.heap, childNode, $get_4(this$static.heap, node));
|
|
2838
|
+
}
|
|
2839
|
+
$set_7(this$static.heap, node, e);
|
|
2840
|
+
return true;
|
|
2841
|
+
}
|
|
2842
|
+
function $poll(this$static) {
|
|
2843
|
+
if (this$static.heap.size === 0) {
|
|
2844
|
+
return null;
|
|
2845
|
+
}
|
|
2846
|
+
const value = $get_4(this$static.heap, 0);
|
|
2847
|
+
$removeAtIndex(this$static);
|
|
2848
|
+
return value;
|
|
2849
|
+
}
|
|
2850
|
+
function $removeAtIndex(this$static) {
|
|
2851
|
+
const lastValue = $remove_0(this$static.heap, this$static.heap.size - 1);
|
|
2852
|
+
if (0 < this$static.heap.size) {
|
|
2853
|
+
$set_7(this$static.heap, 0, lastValue);
|
|
2854
|
+
$mergeHeaps(this$static, 0);
|
|
2855
|
+
}
|
|
2856
|
+
}
|
|
2857
|
+
function $toArray_1(this$static, a) {
|
|
2858
|
+
return $toArray_0(this$static.heap, a);
|
|
2859
|
+
}
|
|
2860
|
+
function PriorityQueue_0(cmp) {
|
|
2861
|
+
this.heap = new ArrayList_1();
|
|
2862
|
+
this.cmp = cmp;
|
|
2863
|
+
}
|
|
2864
|
+
defineSeed(239, 1, {}, PriorityQueue_0);
|
|
2865
|
+
_.cmp = null;
|
|
2866
|
+
_.heap = null;
|
|
2867
|
+
var Ljava_lang_Object_2_classLit = createForClass(
|
|
2868
|
+
"java.lang.",
|
|
2869
|
+
"Object",
|
|
2870
|
+
1,
|
|
2871
|
+
null
|
|
2872
|
+
);
|
|
2873
|
+
var _3Ljava_lang_Object_2_classLit = createForArray(
|
|
2874
|
+
"[Ljava.lang.",
|
|
2875
|
+
"Object;",
|
|
2876
|
+
356,
|
|
2877
|
+
Ljava_lang_Object_2_classLit
|
|
2878
|
+
);
|
|
2879
|
+
var Lcs_threephase_FullCube_2_classLit = createForClass(
|
|
2880
|
+
"cs.threephase.",
|
|
2881
|
+
"FullCube",
|
|
2882
|
+
160,
|
|
2883
|
+
Ljava_lang_Object_2_classLit
|
|
2884
|
+
);
|
|
2885
|
+
var _3Lcs_threephase_FullCube_2_classLit = createForArray(
|
|
2886
|
+
"[Lcs.threephase.",
|
|
2887
|
+
"FullCube;",
|
|
2888
|
+
381,
|
|
2889
|
+
Lcs_threephase_FullCube_2_classLit
|
|
2890
|
+
);
|
|
2891
|
+
var searcher;
|
|
2892
|
+
var raninit = false;
|
|
2893
|
+
function init() {
|
|
2894
|
+
if (raninit) {
|
|
2895
|
+
return;
|
|
2896
|
+
}
|
|
2897
|
+
raninit = true;
|
|
2898
|
+
$clinit_Moves();
|
|
2899
|
+
$clinit_Util_0();
|
|
2900
|
+
$clinit_Center1();
|
|
2901
|
+
$clinit_Center2();
|
|
2902
|
+
$clinit_Center3();
|
|
2903
|
+
$clinit_Edge3();
|
|
2904
|
+
$clinit_CornerCube();
|
|
2905
|
+
$clinit_EdgeCube();
|
|
2906
|
+
$clinit_FullCube_0();
|
|
2907
|
+
searcher = new Search_4();
|
|
2908
|
+
}
|
|
2909
|
+
function initialize() {
|
|
2910
|
+
init();
|
|
2911
|
+
init_5();
|
|
2912
|
+
}
|
|
2913
|
+
async function random444Scramble() {
|
|
2914
|
+
init();
|
|
2915
|
+
const suffix = Alg.fromString($randomState(searcher));
|
|
2916
|
+
return (await random333Scramble()).concat(suffix);
|
|
2917
|
+
}
|
|
2918
|
+
export {
|
|
2919
|
+
initialize,
|
|
2920
|
+
random444Scramble
|
|
2921
|
+
};
|
|
2922
|
+
//# sourceMappingURL=search-dynamic-solve-4x4x4-COSEVJBV.js.map
|