@rednaxela101/cubing 0.63.5
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/README.md +120 -0
- package/alg/index.d.ts +1 -0
- package/bluetooth/index.d.ts +1 -0
- package/dist/bin/chunks/chunk-22VWCGBC.js +13 -0
- package/dist/bin/chunks/chunk-22VWCGBC.js.map +7 -0
- package/dist/bin/order.js +59 -0
- package/dist/bin/order.js.map +7 -0
- package/dist/bin/puzzle-geometry-bin.js +407 -0
- package/dist/bin/puzzle-geometry-bin.js.map +7 -0
- package/dist/bin/scramble.js +188 -0
- package/dist/bin/scramble.js.map +7 -0
- package/dist/bin/svg.js +56 -0
- package/dist/bin/svg.js.map +7 -0
- package/dist/lib/cubing/alg/index.d.ts +2 -0
- package/dist/lib/cubing/alg/index.js +43 -0
- package/dist/lib/cubing/alg/index.js.map +7 -0
- package/dist/lib/cubing/bluetooth/index.d.ts +189 -0
- package/dist/lib/cubing/bluetooth/index.js +2271 -0
- package/dist/lib/cubing/bluetooth/index.js.map +7 -0
- package/dist/lib/cubing/chunks/big-puzzle-orientation-BA6QHO5C.js +68 -0
- package/dist/lib/cubing/chunks/big-puzzle-orientation-BA6QHO5C.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-2VJB4TMH.js +1774 -0
- package/dist/lib/cubing/chunks/chunk-2VJB4TMH.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-52ZXJEUO.js +665 -0
- package/dist/lib/cubing/chunks/chunk-52ZXJEUO.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-56VZAEPF.js +274 -0
- package/dist/lib/cubing/chunks/chunk-56VZAEPF.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-7GUL3OBQ.js +9 -0
- package/dist/lib/cubing/chunks/chunk-7GUL3OBQ.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-7L7BJSIM.js +21 -0
- package/dist/lib/cubing/chunks/chunk-7L7BJSIM.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-AESPJKN6.js +265 -0
- package/dist/lib/cubing/chunks/chunk-AESPJKN6.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-C2Q347XS.js +89 -0
- package/dist/lib/cubing/chunks/chunk-C2Q347XS.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-CGBMJBU3.js +1195 -0
- package/dist/lib/cubing/chunks/chunk-CGBMJBU3.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-HZQONEMD.js +249 -0
- package/dist/lib/cubing/chunks/chunk-HZQONEMD.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-IAGCVPL3.js +1069 -0
- package/dist/lib/cubing/chunks/chunk-IAGCVPL3.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-NAPITA3L.js +1 -0
- package/dist/lib/cubing/chunks/chunk-NAPITA3L.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-XPDJUSZ7.js +1876 -0
- package/dist/lib/cubing/chunks/chunk-XPDJUSZ7.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-YSI6PF35.js +619 -0
- package/dist/lib/cubing/chunks/chunk-YSI6PF35.js.map +7 -0
- package/dist/lib/cubing/chunks/inside-LG2EAKCL.js +557 -0
- package/dist/lib/cubing/chunks/inside-LG2EAKCL.js.map +7 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-2x2x2-JYJJXB4V.js +142 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-2x2x2-JYJJXB4V.js.map +7 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-3x3x3-FYXD7SIU.js +365 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-3x3x3-FYXD7SIU.js.map +7 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-4x4x4-AIGABOAR.js +132 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-4x4x4-AIGABOAR.js.map +7 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-5x5x5-JUNRX27W.js +277 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-5x5x5-JUNRX27W.js.map +7 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-clock-USGQTDPO.js +836 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-clock-USGQTDPO.js.map +7 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-fto-WJHMLYCJ.js +100 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-fto-WJHMLYCJ.js.map +7 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-megaminx-2LVHIDL4.js +224 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-megaminx-2LVHIDL4.js.map +7 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-pyraminx-7UWX4HHI.js +93 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-pyraminx-7UWX4HHI.js.map +7 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-square1-PQEKBPFN.js +842 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-square1-PQEKBPFN.js.map +7 -0
- package/dist/lib/cubing/chunks/search-dynamic-sgs-2x2x2-XFKQ4VJS.js +125 -0
- package/dist/lib/cubing/chunks/search-dynamic-sgs-2x2x2-XFKQ4VJS.js.map +7 -0
- package/dist/lib/cubing/chunks/search-dynamic-sgs-megaminx-ZDOOLEDW.js +1564 -0
- package/dist/lib/cubing/chunks/search-dynamic-sgs-megaminx-ZDOOLEDW.js.map +7 -0
- package/dist/lib/cubing/chunks/search-dynamic-sgs-pyraminx-W6UJWBYY.js +108 -0
- package/dist/lib/cubing/chunks/search-dynamic-sgs-pyraminx-W6UJWBYY.js.map +7 -0
- package/dist/lib/cubing/chunks/search-dynamic-sgs-skewb-FXGKV4KD.js +125 -0
- package/dist/lib/cubing/chunks/search-dynamic-sgs-skewb-FXGKV4KD.js.map +7 -0
- package/dist/lib/cubing/chunks/search-dynamic-sgs-unofficial-YK6HA7BK.js +644 -0
- package/dist/lib/cubing/chunks/search-dynamic-sgs-unofficial-YK6HA7BK.js.map +7 -0
- package/dist/lib/cubing/chunks/search-dynamic-solve-3x3x3-DLMAGPXS.js +2549 -0
- package/dist/lib/cubing/chunks/search-dynamic-solve-3x3x3-DLMAGPXS.js.map +7 -0
- package/dist/lib/cubing/chunks/search-dynamic-solve-4x4x4-NONXQHOJ.js +2923 -0
- package/dist/lib/cubing/chunks/search-dynamic-solve-4x4x4-NONXQHOJ.js.map +7 -0
- package/dist/lib/cubing/chunks/search-dynamic-solve-fto-3GQ2HLSW.js +1405 -0
- package/dist/lib/cubing/chunks/search-dynamic-solve-fto-3GQ2HLSW.js.map +7 -0
- package/dist/lib/cubing/chunks/search-worker-entry.js +19 -0
- package/dist/lib/cubing/chunks/search-worker-entry.js.map +7 -0
- package/dist/lib/cubing/chunks/square1-stickerings-W2ZLZWIN.js +73 -0
- package/dist/lib/cubing/chunks/square1-stickerings-W2ZLZWIN.js.map +7 -0
- package/dist/lib/cubing/chunks/twips-2RNTWYNZ.js +433 -0
- package/dist/lib/cubing/chunks/twips-2RNTWYNZ.js.map +7 -0
- package/dist/lib/cubing/chunks/twips_wasm_bg-TJNYGA2C-23XTPLIK.js +10 -0
- package/dist/lib/cubing/chunks/twips_wasm_bg-TJNYGA2C-23XTPLIK.js.map +7 -0
- package/dist/lib/cubing/chunks/twisty-dynamic-3d-JO6OGKOF.js +2424 -0
- package/dist/lib/cubing/chunks/twisty-dynamic-3d-JO6OGKOF.js.map +7 -0
- package/dist/lib/cubing/index-BX6f56uo.d.ts +76 -0
- package/dist/lib/cubing/index-CcRu94bx.d.ts +2622 -0
- package/dist/lib/cubing/kpuzzle/index.d.ts +2 -0
- package/dist/lib/cubing/kpuzzle/index.js +12 -0
- package/dist/lib/cubing/kpuzzle/index.js.map +7 -0
- package/dist/lib/cubing/notation/index.d.ts +32 -0
- package/dist/lib/cubing/notation/index.js +20 -0
- package/dist/lib/cubing/notation/index.js.map +7 -0
- package/dist/lib/cubing/outside-BCzgSYQ_.d.ts +38 -0
- package/dist/lib/cubing/protocol/index.d.ts +28 -0
- package/dist/lib/cubing/protocol/index.js +20 -0
- package/dist/lib/cubing/protocol/index.js.map +7 -0
- package/dist/lib/cubing/puzzle-geometry/index.d.ts +2 -0
- package/dist/lib/cubing/puzzle-geometry/index.js +5024 -0
- package/dist/lib/cubing/puzzle-geometry/index.js.map +7 -0
- package/dist/lib/cubing/puzzles/index.d.ts +2 -0
- package/dist/lib/cubing/puzzles/index.js +23 -0
- package/dist/lib/cubing/puzzles/index.js.map +7 -0
- package/dist/lib/cubing/scramble/index.d.ts +2 -0
- package/dist/lib/cubing/scramble/index.js +16 -0
- package/dist/lib/cubing/scramble/index.js.map +7 -0
- package/dist/lib/cubing/search/index.d.ts +7 -0
- package/dist/lib/cubing/search/index.js +37 -0
- package/dist/lib/cubing/search/index.js.map +7 -0
- package/dist/lib/cubing/stream/index.d.ts +2 -0
- package/dist/lib/cubing/stream/index.js +111 -0
- package/dist/lib/cubing/stream/index.js.map +7 -0
- package/dist/lib/cubing/twisty/index.d.ts +2 -0
- package/dist/lib/cubing/twisty/index.js +6236 -0
- package/dist/lib/cubing/twisty/index.js.map +7 -0
- package/experimental-json-schema/kpuzzle/KPatternData.schema.json +34 -0
- package/experimental-json-schema/kpuzzle/KPuzzleDefinition.schema.json +97 -0
- package/experimental-json-schema/kpuzzle/KTransformationData.schema.json +27 -0
- package/kpuzzle/index.d.ts +1 -0
- package/notation/index.d.ts +1 -0
- package/package.json +146 -0
- package/protocol/index.d.ts +1 -0
- package/puzzle-geometry/index.d.ts +1 -0
- package/puzzles/index.d.ts +1 -0
- package/scramble/index.d.ts +1 -0
- package/search/index.d.ts +1 -0
- package/stream/index.d.ts +1 -0
- package/twisty/index.d.ts +1 -0
|
@@ -0,0 +1,2549 @@
|
|
|
1
|
+
// src/cubing/vendor/mit/cs0x7f/min2phase/3x3x3-min2phase.js
|
|
2
|
+
var $intern_3 = { 3: 1 };
|
|
3
|
+
var $intern_9 = 4194303;
|
|
4
|
+
var $intern_10 = 1048575;
|
|
5
|
+
var $intern_11 = 524288;
|
|
6
|
+
var $intern_20 = 65535;
|
|
7
|
+
var $intern_26 = { 11: 1, 3: 1 };
|
|
8
|
+
var $intern_27 = { 17: 1, 3: 1 };
|
|
9
|
+
var $intern_28 = 14540032;
|
|
10
|
+
var $intern_29 = 286331153;
|
|
11
|
+
var $intern_30 = { 10: 1, 3: 1 };
|
|
12
|
+
var _;
|
|
13
|
+
var prototypesByTypeId_0 = {};
|
|
14
|
+
function typeMarkerFn() {
|
|
15
|
+
}
|
|
16
|
+
function portableObjCreate(obj) {
|
|
17
|
+
function F() {
|
|
18
|
+
}
|
|
19
|
+
F.prototype = obj || {};
|
|
20
|
+
return new F();
|
|
21
|
+
}
|
|
22
|
+
function maybeGetClassLiteralFromPlaceHolder_0(entry) {
|
|
23
|
+
return entry instanceof Array ? entry[0] : null;
|
|
24
|
+
}
|
|
25
|
+
function defineClass(typeId, superTypeId, castableTypeMap) {
|
|
26
|
+
var prototypesByTypeId = prototypesByTypeId_0;
|
|
27
|
+
var createSubclassPrototype = createSubclassPrototype_0;
|
|
28
|
+
var maybeGetClassLiteralFromPlaceHolder = maybeGetClassLiteralFromPlaceHolder_0;
|
|
29
|
+
var prototype_0 = prototypesByTypeId[typeId];
|
|
30
|
+
var clazz = maybeGetClassLiteralFromPlaceHolder(prototype_0);
|
|
31
|
+
if (prototype_0 && !clazz) {
|
|
32
|
+
_ = prototype_0;
|
|
33
|
+
} else {
|
|
34
|
+
_ = prototypesByTypeId[typeId] = !superTypeId ? {} : createSubclassPrototype(superTypeId);
|
|
35
|
+
_.castableTypeMap$ = castableTypeMap;
|
|
36
|
+
_.constructor = _;
|
|
37
|
+
!superTypeId && (_.typeMarker$ = typeMarkerFn);
|
|
38
|
+
}
|
|
39
|
+
for (let i = 3; i < arguments.length; ++i) {
|
|
40
|
+
arguments[i].prototype = _;
|
|
41
|
+
}
|
|
42
|
+
clazz && (_.___clazz$ = clazz);
|
|
43
|
+
}
|
|
44
|
+
function createSubclassPrototype_0(superTypeId) {
|
|
45
|
+
var prototypesByTypeId = prototypesByTypeId_0;
|
|
46
|
+
return portableObjCreate(prototypesByTypeId[superTypeId]);
|
|
47
|
+
}
|
|
48
|
+
function Object_0() {
|
|
49
|
+
}
|
|
50
|
+
defineClass(1, null, {}, Object_0);
|
|
51
|
+
function narrow_byte(x_0) {
|
|
52
|
+
return x_0 << 24 >> 24;
|
|
53
|
+
}
|
|
54
|
+
function Class() {
|
|
55
|
+
this.typeName = null;
|
|
56
|
+
this.simpleName = null;
|
|
57
|
+
this.packageName = null;
|
|
58
|
+
this.compoundName = null;
|
|
59
|
+
this.canonicalName = null;
|
|
60
|
+
this.typeId = null;
|
|
61
|
+
this.arrayLiterals = null;
|
|
62
|
+
}
|
|
63
|
+
function createClassObject(packageName, compoundClassName) {
|
|
64
|
+
var clazz;
|
|
65
|
+
clazz = new Class();
|
|
66
|
+
clazz.packageName = packageName;
|
|
67
|
+
clazz.compoundName = compoundClassName;
|
|
68
|
+
return clazz;
|
|
69
|
+
}
|
|
70
|
+
function createForClass(packageName, compoundClassName, typeId) {
|
|
71
|
+
var clazz;
|
|
72
|
+
clazz = createClassObject(packageName, compoundClassName);
|
|
73
|
+
maybeSetClassLiteral(typeId, clazz);
|
|
74
|
+
return clazz;
|
|
75
|
+
}
|
|
76
|
+
function createForInterface(packageName, compoundClassName) {
|
|
77
|
+
var clazz;
|
|
78
|
+
clazz = createClassObject(packageName, compoundClassName);
|
|
79
|
+
clazz.modifiers = 2;
|
|
80
|
+
return clazz;
|
|
81
|
+
}
|
|
82
|
+
function createForPrimitive(className, primitiveTypeId) {
|
|
83
|
+
var clazz;
|
|
84
|
+
clazz = createClassObject("", className);
|
|
85
|
+
clazz.typeId = primitiveTypeId;
|
|
86
|
+
clazz.modifiers = 1;
|
|
87
|
+
return clazz;
|
|
88
|
+
}
|
|
89
|
+
function getClassLiteralForArray_0(leafClass, dimensions) {
|
|
90
|
+
var arrayLiterals = leafClass.arrayLiterals = leafClass.arrayLiterals || [];
|
|
91
|
+
return arrayLiterals[dimensions] || (arrayLiterals[dimensions] = leafClass.createClassLiteralForArray(dimensions));
|
|
92
|
+
}
|
|
93
|
+
function getPrototypeForClass(clazz) {
|
|
94
|
+
if (clazz.isPrimitive()) {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
var typeId = clazz.typeId;
|
|
98
|
+
var prototype_0 = prototypesByTypeId_0[typeId];
|
|
99
|
+
return prototype_0;
|
|
100
|
+
}
|
|
101
|
+
function maybeSetClassLiteral(typeId, clazz) {
|
|
102
|
+
if (!typeId) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
clazz.typeId = typeId;
|
|
106
|
+
var prototype_0 = getPrototypeForClass(clazz);
|
|
107
|
+
if (!prototype_0) {
|
|
108
|
+
prototypesByTypeId_0[typeId] = [clazz];
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
prototype_0.___clazz$ = clazz;
|
|
112
|
+
}
|
|
113
|
+
defineClass(79, 1, {}, Class);
|
|
114
|
+
_.createClassLiteralForArray = function createClassLiteralForArray(dimensions) {
|
|
115
|
+
var clazz;
|
|
116
|
+
clazz = new Class();
|
|
117
|
+
clazz.modifiers = 4;
|
|
118
|
+
dimensions > 1 ? clazz.componentType = getClassLiteralForArray_0(this, dimensions - 1) : clazz.componentType = this;
|
|
119
|
+
return clazz;
|
|
120
|
+
};
|
|
121
|
+
_.isPrimitive = function isPrimitive() {
|
|
122
|
+
return (this.modifiers & 1) !== 0;
|
|
123
|
+
};
|
|
124
|
+
function getClassLiteralForArray(clazz, dimensions) {
|
|
125
|
+
return getClassLiteralForArray_0(clazz, dimensions);
|
|
126
|
+
}
|
|
127
|
+
function initDim(leafClassLiteral, castableTypeMap, elementTypeId, length_0, elementTypeCategory, dimensions) {
|
|
128
|
+
var result;
|
|
129
|
+
result = initializeArrayElementsWithDefaults(elementTypeCategory, length_0);
|
|
130
|
+
initValues(
|
|
131
|
+
getClassLiteralForArray(leafClassLiteral, dimensions),
|
|
132
|
+
castableTypeMap,
|
|
133
|
+
elementTypeId,
|
|
134
|
+
elementTypeCategory,
|
|
135
|
+
result
|
|
136
|
+
);
|
|
137
|
+
return result;
|
|
138
|
+
}
|
|
139
|
+
function initDims(leafClassLiteral, castableTypeMapExprs, elementTypeIds, leafElementTypeCategory, dimExprs, count) {
|
|
140
|
+
return initDims_0(
|
|
141
|
+
leafClassLiteral,
|
|
142
|
+
castableTypeMapExprs,
|
|
143
|
+
elementTypeIds,
|
|
144
|
+
leafElementTypeCategory,
|
|
145
|
+
dimExprs,
|
|
146
|
+
0,
|
|
147
|
+
count
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
function initDims_0(leafClassLiteral, castableTypeMapExprs, elementTypeIds, leafElementTypeCategory, dimExprs, index_0, count) {
|
|
151
|
+
var elementTypeCategory;
|
|
152
|
+
var i;
|
|
153
|
+
var isLastDim;
|
|
154
|
+
var length_0;
|
|
155
|
+
var result;
|
|
156
|
+
length_0 = dimExprs[index_0];
|
|
157
|
+
isLastDim = index_0 === count - 1;
|
|
158
|
+
elementTypeCategory = isLastDim ? leafElementTypeCategory : 0;
|
|
159
|
+
result = initializeArrayElementsWithDefaults(elementTypeCategory, length_0);
|
|
160
|
+
initValues(
|
|
161
|
+
getClassLiteralForArray(leafClassLiteral, count - index_0),
|
|
162
|
+
castableTypeMapExprs[index_0],
|
|
163
|
+
elementTypeIds[index_0],
|
|
164
|
+
elementTypeCategory,
|
|
165
|
+
result
|
|
166
|
+
);
|
|
167
|
+
if (!isLastDim) {
|
|
168
|
+
++index_0;
|
|
169
|
+
for (i = 0; i < length_0; ++i) {
|
|
170
|
+
result[i] = initDims_0(
|
|
171
|
+
leafClassLiteral,
|
|
172
|
+
castableTypeMapExprs,
|
|
173
|
+
elementTypeIds,
|
|
174
|
+
leafElementTypeCategory,
|
|
175
|
+
dimExprs,
|
|
176
|
+
index_0,
|
|
177
|
+
count
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return result;
|
|
182
|
+
}
|
|
183
|
+
function initValues(arrayClass, castableTypeMap, elementTypeId, elementTypeCategory, array) {
|
|
184
|
+
array.___clazz$ = arrayClass;
|
|
185
|
+
array.castableTypeMap$ = castableTypeMap;
|
|
186
|
+
array.typeMarker$ = typeMarkerFn;
|
|
187
|
+
array.__elementTypeId$ = elementTypeId;
|
|
188
|
+
array.__elementTypeCategory$ = elementTypeCategory;
|
|
189
|
+
return array;
|
|
190
|
+
}
|
|
191
|
+
function initializeArrayElementsWithDefaults(elementTypeCategory, length_0) {
|
|
192
|
+
var array = new Array(length_0);
|
|
193
|
+
var initValue;
|
|
194
|
+
switch (elementTypeCategory) {
|
|
195
|
+
case 6: {
|
|
196
|
+
initValue = { l: 0, m: 0, h: 0 };
|
|
197
|
+
break;
|
|
198
|
+
}
|
|
199
|
+
case 7: {
|
|
200
|
+
initValue = 0;
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
case 8: {
|
|
204
|
+
initValue = false;
|
|
205
|
+
break;
|
|
206
|
+
}
|
|
207
|
+
default:
|
|
208
|
+
return array;
|
|
209
|
+
}
|
|
210
|
+
for (var i = 0; i < length_0; ++i) {
|
|
211
|
+
array[i] = initValue;
|
|
212
|
+
}
|
|
213
|
+
return array;
|
|
214
|
+
}
|
|
215
|
+
function create(value_0) {
|
|
216
|
+
var a0;
|
|
217
|
+
var a1;
|
|
218
|
+
var a2;
|
|
219
|
+
a0 = value_0 & $intern_9;
|
|
220
|
+
a1 = value_0 >> 22 & $intern_9;
|
|
221
|
+
a2 = value_0 < 0 ? $intern_10 : 0;
|
|
222
|
+
return create0(a0, a1, a2);
|
|
223
|
+
}
|
|
224
|
+
function create0(l, m, h) {
|
|
225
|
+
return { l, m, h };
|
|
226
|
+
}
|
|
227
|
+
function add_1(a, b) {
|
|
228
|
+
var sum0;
|
|
229
|
+
var sum1;
|
|
230
|
+
var sum2;
|
|
231
|
+
sum0 = a.l + b.l;
|
|
232
|
+
sum1 = a.m + b.m + (sum0 >> 22);
|
|
233
|
+
sum2 = a.h + b.h + (sum1 >> 22);
|
|
234
|
+
return { l: sum0 & $intern_9, m: sum1 & $intern_9, h: sum2 & $intern_10 };
|
|
235
|
+
}
|
|
236
|
+
function and(a, b) {
|
|
237
|
+
return { l: a.l & b.l, m: a.m & b.m, h: a.h & b.h };
|
|
238
|
+
}
|
|
239
|
+
function fromInt(value_0) {
|
|
240
|
+
var rebase;
|
|
241
|
+
var result;
|
|
242
|
+
if (value_0 > -129 && value_0 < 128) {
|
|
243
|
+
rebase = value_0 + 128;
|
|
244
|
+
boxedValues == null && (boxedValues = initDim(
|
|
245
|
+
Lcom_google_gwt_lang_LongLibBase$LongEmul_2_classLit,
|
|
246
|
+
$intern_3,
|
|
247
|
+
293,
|
|
248
|
+
256,
|
|
249
|
+
0,
|
|
250
|
+
1
|
|
251
|
+
));
|
|
252
|
+
result = boxedValues[rebase];
|
|
253
|
+
!result && (result = boxedValues[rebase] = create(value_0));
|
|
254
|
+
return result;
|
|
255
|
+
}
|
|
256
|
+
return create(value_0);
|
|
257
|
+
}
|
|
258
|
+
function gte(a, b) {
|
|
259
|
+
var signa;
|
|
260
|
+
var signb;
|
|
261
|
+
signa = a.h >> 19;
|
|
262
|
+
signb = b.h >> 19;
|
|
263
|
+
return signa === 0 ? signb !== 0 || a.h > b.h || a.h === b.h && a.m > b.m || a.h === b.h && a.m === b.m && a.l >= b.l : !(signb === 0 || a.h < b.h || a.h === b.h && a.m < b.m || a.h === b.h && a.m === b.m && a.l < b.l);
|
|
264
|
+
}
|
|
265
|
+
function neq(a, b) {
|
|
266
|
+
return a.l !== b.l || a.m !== b.m || a.h !== b.h;
|
|
267
|
+
}
|
|
268
|
+
function or(a, b) {
|
|
269
|
+
return { l: a.l | b.l, m: a.m | b.m, h: a.h | b.h };
|
|
270
|
+
}
|
|
271
|
+
function shl(a, n) {
|
|
272
|
+
var res0;
|
|
273
|
+
var res1;
|
|
274
|
+
var res2;
|
|
275
|
+
n &= 63;
|
|
276
|
+
if (n < 22) {
|
|
277
|
+
res0 = a.l << n;
|
|
278
|
+
res1 = a.m << n | a.l >> 22 - n;
|
|
279
|
+
res2 = a.h << n | a.m >> 22 - n;
|
|
280
|
+
} else if (n < 44) {
|
|
281
|
+
res0 = 0;
|
|
282
|
+
res1 = a.l << n - 22;
|
|
283
|
+
res2 = a.m << n - 22 | a.l >> 44 - n;
|
|
284
|
+
} else {
|
|
285
|
+
res0 = 0;
|
|
286
|
+
res1 = 0;
|
|
287
|
+
res2 = a.l << n - 44;
|
|
288
|
+
}
|
|
289
|
+
return { l: res0 & $intern_9, m: res1 & $intern_9, h: res2 & $intern_10 };
|
|
290
|
+
}
|
|
291
|
+
function shr(a, n) {
|
|
292
|
+
var a2;
|
|
293
|
+
var negative;
|
|
294
|
+
var res0;
|
|
295
|
+
var res1;
|
|
296
|
+
var res2;
|
|
297
|
+
n &= 63;
|
|
298
|
+
a2 = a.h;
|
|
299
|
+
negative = (a2 & $intern_11) !== 0;
|
|
300
|
+
negative && (a2 |= -1048576);
|
|
301
|
+
if (n < 22) {
|
|
302
|
+
res2 = a2 >> n;
|
|
303
|
+
res1 = a.m >> n | a2 << 22 - n;
|
|
304
|
+
res0 = a.l >> n | a.m << 22 - n;
|
|
305
|
+
} else if (n < 44) {
|
|
306
|
+
res2 = negative ? $intern_10 : 0;
|
|
307
|
+
res1 = a2 >> n - 22;
|
|
308
|
+
res0 = a.m >> n - 22 | a2 << 44 - n;
|
|
309
|
+
} else {
|
|
310
|
+
res2 = negative ? $intern_10 : 0;
|
|
311
|
+
res1 = negative ? $intern_9 : 0;
|
|
312
|
+
res0 = a2 >> n - 44;
|
|
313
|
+
}
|
|
314
|
+
return { l: res0 & $intern_9, m: res1 & $intern_9, h: res2 & $intern_10 };
|
|
315
|
+
}
|
|
316
|
+
function sub_0(a, b) {
|
|
317
|
+
var sum0;
|
|
318
|
+
var sum1;
|
|
319
|
+
var sum2;
|
|
320
|
+
sum0 = a.l - b.l;
|
|
321
|
+
sum1 = a.m - b.m + (sum0 >> 22);
|
|
322
|
+
sum2 = a.h - b.h + (sum1 >> 22);
|
|
323
|
+
return { l: sum0 & $intern_9, m: sum1 & $intern_9, h: sum2 & $intern_10 };
|
|
324
|
+
}
|
|
325
|
+
function toInt(a) {
|
|
326
|
+
return a.l | a.m << 22;
|
|
327
|
+
}
|
|
328
|
+
var boxedValues;
|
|
329
|
+
function AbstractStringBuilder(string) {
|
|
330
|
+
this.string = string;
|
|
331
|
+
}
|
|
332
|
+
function max_0(x_0, y_0) {
|
|
333
|
+
return x_0 > y_0 ? x_0 : y_0;
|
|
334
|
+
}
|
|
335
|
+
function min_0(x_0, y_0) {
|
|
336
|
+
return x_0 < y_0 ? x_0 : y_0;
|
|
337
|
+
}
|
|
338
|
+
function $indexOf_0(this$static, str) {
|
|
339
|
+
return this$static.indexOf(str);
|
|
340
|
+
}
|
|
341
|
+
function _String(value_0) {
|
|
342
|
+
return __valueOf(value_0, 0, value_0.length);
|
|
343
|
+
}
|
|
344
|
+
function __valueOf(x_0, start_0, end) {
|
|
345
|
+
var s = "";
|
|
346
|
+
for (var batchStart = start_0; batchStart < end; ) {
|
|
347
|
+
var batchEnd = Math.min(batchStart + 1e4, end);
|
|
348
|
+
s += String.fromCharCode.apply(null, x_0.slice(batchStart, batchEnd));
|
|
349
|
+
batchStart = batchEnd;
|
|
350
|
+
}
|
|
351
|
+
return s;
|
|
352
|
+
}
|
|
353
|
+
function fromCodePoint(codePoint) {
|
|
354
|
+
return String.fromCharCode(codePoint & $intern_20);
|
|
355
|
+
}
|
|
356
|
+
var Ljava_lang_String_2_classLit = createForClass("java.lang", "String", 2);
|
|
357
|
+
function $append(this$static) {
|
|
358
|
+
this$static.string += " ";
|
|
359
|
+
return this$static;
|
|
360
|
+
}
|
|
361
|
+
function $append_1(this$static, x_0) {
|
|
362
|
+
this$static.string += x_0;
|
|
363
|
+
return this$static;
|
|
364
|
+
}
|
|
365
|
+
function StringBuffer() {
|
|
366
|
+
AbstractStringBuilder.call(this, "");
|
|
367
|
+
}
|
|
368
|
+
function equals_7(array1, array2) {
|
|
369
|
+
var i;
|
|
370
|
+
if (array1 === array2) {
|
|
371
|
+
return true;
|
|
372
|
+
}
|
|
373
|
+
if (array1.length !== array2.length) {
|
|
374
|
+
return false;
|
|
375
|
+
}
|
|
376
|
+
for (i = 0; i < array1.length; ++i) {
|
|
377
|
+
if (array1[i] !== array2[i]) {
|
|
378
|
+
return false;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
return true;
|
|
382
|
+
}
|
|
383
|
+
var $clinit_CoordCube_ran = false;
|
|
384
|
+
function $clinit_CoordCube() {
|
|
385
|
+
if ($clinit_CoordCube_ran) {
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
$clinit_CoordCube_ran = true;
|
|
389
|
+
UDSliceMove = initDims(
|
|
390
|
+
C_classLit,
|
|
391
|
+
[$intern_3, $intern_26],
|
|
392
|
+
[11, 0],
|
|
393
|
+
7,
|
|
394
|
+
[495, 18],
|
|
395
|
+
2
|
|
396
|
+
);
|
|
397
|
+
TwistMove = initDims(
|
|
398
|
+
C_classLit,
|
|
399
|
+
[$intern_3, $intern_26],
|
|
400
|
+
[11, 0],
|
|
401
|
+
7,
|
|
402
|
+
[324, 18],
|
|
403
|
+
2
|
|
404
|
+
);
|
|
405
|
+
FlipMove = initDims(
|
|
406
|
+
C_classLit,
|
|
407
|
+
[$intern_3, $intern_26],
|
|
408
|
+
[11, 0],
|
|
409
|
+
7,
|
|
410
|
+
[336, 18],
|
|
411
|
+
2
|
|
412
|
+
);
|
|
413
|
+
UDSliceConj = initDims(
|
|
414
|
+
C_classLit,
|
|
415
|
+
[$intern_3, $intern_26],
|
|
416
|
+
[11, 0],
|
|
417
|
+
7,
|
|
418
|
+
[495, 8],
|
|
419
|
+
2
|
|
420
|
+
);
|
|
421
|
+
UDSliceTwistPrun = initDim(I_classLit, $intern_27, 0, 20048, 7, 1);
|
|
422
|
+
UDSliceFlipPrun = initDim(I_classLit, $intern_27, 0, 20791, 7, 1);
|
|
423
|
+
TwistFlipPrun = initDim(I_classLit, $intern_27, 0, 82945, 7, 1);
|
|
424
|
+
CPermMove = initDims(
|
|
425
|
+
C_classLit,
|
|
426
|
+
[$intern_3, $intern_26],
|
|
427
|
+
[11, 0],
|
|
428
|
+
7,
|
|
429
|
+
[2768, 10],
|
|
430
|
+
2
|
|
431
|
+
);
|
|
432
|
+
EPermMove = initDims(
|
|
433
|
+
C_classLit,
|
|
434
|
+
[$intern_3, $intern_26],
|
|
435
|
+
[11, 0],
|
|
436
|
+
7,
|
|
437
|
+
[2768, 10],
|
|
438
|
+
2
|
|
439
|
+
);
|
|
440
|
+
MPermMove = initDims(
|
|
441
|
+
C_classLit,
|
|
442
|
+
[$intern_3, $intern_26],
|
|
443
|
+
[11, 0],
|
|
444
|
+
7,
|
|
445
|
+
[24, 10],
|
|
446
|
+
2
|
|
447
|
+
);
|
|
448
|
+
MPermConj = initDims(
|
|
449
|
+
C_classLit,
|
|
450
|
+
[$intern_3, $intern_26],
|
|
451
|
+
[11, 0],
|
|
452
|
+
7,
|
|
453
|
+
[24, 16],
|
|
454
|
+
2
|
|
455
|
+
);
|
|
456
|
+
CCombPConj = initDims(
|
|
457
|
+
C_classLit,
|
|
458
|
+
[$intern_3, $intern_26],
|
|
459
|
+
[11, 0],
|
|
460
|
+
7,
|
|
461
|
+
[140, 16],
|
|
462
|
+
2
|
|
463
|
+
);
|
|
464
|
+
MCPermPrun = initDim(I_classLit, $intern_27, 0, 8305, 7, 1);
|
|
465
|
+
EPermCCombPPrun = initDim(I_classLit, $intern_27, 0, 48441, 7, 1);
|
|
466
|
+
}
|
|
467
|
+
function $doMovePrun(this$static, cc, m) {
|
|
468
|
+
this$static.slice_0 = UDSliceMove[cc.slice_0][m];
|
|
469
|
+
this$static.flip = FlipMove[cc.flip][($clinit_CubieCube(), Sym8Move)[m << 3 | cc.fsym]];
|
|
470
|
+
this$static.fsym = this$static.flip & 7 ^ cc.fsym;
|
|
471
|
+
this$static.flip >>= 3;
|
|
472
|
+
this$static.twist = TwistMove[cc.twist][Sym8Move[m << 3 | cc.tsym]];
|
|
473
|
+
this$static.tsym = this$static.twist & 7 ^ cc.tsym;
|
|
474
|
+
this$static.twist >>= 3;
|
|
475
|
+
this$static.prun = max_0(
|
|
476
|
+
max_0(
|
|
477
|
+
getPruning(
|
|
478
|
+
UDSliceTwistPrun,
|
|
479
|
+
this$static.twist * 495 + UDSliceConj[this$static.slice_0][this$static.tsym]
|
|
480
|
+
),
|
|
481
|
+
getPruning(
|
|
482
|
+
UDSliceFlipPrun,
|
|
483
|
+
this$static.flip * 495 + UDSliceConj[this$static.slice_0][this$static.fsym]
|
|
484
|
+
)
|
|
485
|
+
),
|
|
486
|
+
getPruning(
|
|
487
|
+
TwistFlipPrun,
|
|
488
|
+
this$static.twist << 11 | FlipS2RF[this$static.flip << 3 | this$static.fsym ^ this$static.tsym]
|
|
489
|
+
)
|
|
490
|
+
);
|
|
491
|
+
return this$static.prun;
|
|
492
|
+
}
|
|
493
|
+
function $doMovePrunConj(this$static, cc, m) {
|
|
494
|
+
m = ($clinit_CubieCube(), SymMove_0)[3][m];
|
|
495
|
+
this$static.flipc = FlipMove[cc.flipc >> 3][Sym8Move[m << 3 | cc.flipc & 7]] ^ cc.flipc & 7;
|
|
496
|
+
this$static.twistc = TwistMove[cc.twistc >> 3][Sym8Move[m << 3 | cc.twistc & 7]] ^ cc.twistc & 7;
|
|
497
|
+
return getPruning(
|
|
498
|
+
TwistFlipPrun,
|
|
499
|
+
this$static.twistc >> 3 << 11 | FlipS2RF[this$static.flipc ^ this$static.twistc & 7]
|
|
500
|
+
);
|
|
501
|
+
}
|
|
502
|
+
function $setWithPrun(this$static, cc, depth) {
|
|
503
|
+
var pc;
|
|
504
|
+
this$static.twist = ($clinit_CubieCube(), TwistR2S)[$getTwist(cc)];
|
|
505
|
+
this$static.flip = FlipR2S[$getFlip(cc)];
|
|
506
|
+
this$static.tsym = this$static.twist & 7;
|
|
507
|
+
this$static.twist = this$static.twist >> 3;
|
|
508
|
+
this$static.prun = getPruning(
|
|
509
|
+
TwistFlipPrun,
|
|
510
|
+
this$static.twist << 11 | FlipS2RF[this$static.flip ^ this$static.tsym]
|
|
511
|
+
);
|
|
512
|
+
if (this$static.prun > depth) {
|
|
513
|
+
return false;
|
|
514
|
+
}
|
|
515
|
+
this$static.fsym = this$static.flip & 7;
|
|
516
|
+
this$static.flip = this$static.flip >> 3;
|
|
517
|
+
this$static.slice_0 = 494 - getComb(cc.ea, 8, true);
|
|
518
|
+
this$static.prun = max_0(
|
|
519
|
+
this$static.prun,
|
|
520
|
+
max_0(
|
|
521
|
+
getPruning(
|
|
522
|
+
UDSliceTwistPrun,
|
|
523
|
+
this$static.twist * 495 + UDSliceConj[this$static.slice_0][this$static.tsym]
|
|
524
|
+
),
|
|
525
|
+
getPruning(
|
|
526
|
+
UDSliceFlipPrun,
|
|
527
|
+
this$static.flip * 495 + UDSliceConj[this$static.slice_0][this$static.fsym]
|
|
528
|
+
)
|
|
529
|
+
)
|
|
530
|
+
);
|
|
531
|
+
if (this$static.prun > depth) {
|
|
532
|
+
return false;
|
|
533
|
+
}
|
|
534
|
+
pc = new CubieCube();
|
|
535
|
+
CornConjugate(cc, 1, pc);
|
|
536
|
+
EdgeConjugate(cc, 1, pc);
|
|
537
|
+
this$static.twistc = TwistR2S[$getTwist(pc)];
|
|
538
|
+
this$static.flipc = FlipR2S[$getFlip(pc)];
|
|
539
|
+
this$static.prun = max_0(
|
|
540
|
+
this$static.prun,
|
|
541
|
+
getPruning(
|
|
542
|
+
TwistFlipPrun,
|
|
543
|
+
this$static.twistc >> 3 << 11 | FlipS2RF[this$static.flipc ^ this$static.twistc & 7]
|
|
544
|
+
)
|
|
545
|
+
);
|
|
546
|
+
return this$static.prun <= depth;
|
|
547
|
+
}
|
|
548
|
+
function CoordCube() {
|
|
549
|
+
$clinit_CoordCube();
|
|
550
|
+
}
|
|
551
|
+
function getPruning(table, index_0) {
|
|
552
|
+
$clinit_CoordCube();
|
|
553
|
+
return table[index_0 >> 3] >> (index_0 << 2) & 15;
|
|
554
|
+
}
|
|
555
|
+
function init_0(fullInit) {
|
|
556
|
+
$clinit_CoordCube();
|
|
557
|
+
if (initLevel === 2 || initLevel === 1 && !fullInit) {
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
560
|
+
if (initLevel === 0) {
|
|
561
|
+
initPermSym2Raw();
|
|
562
|
+
initCPermMove();
|
|
563
|
+
initEPermMove();
|
|
564
|
+
initMPermMoveConj();
|
|
565
|
+
initCombPMoveConj();
|
|
566
|
+
$clinit_CubieCube();
|
|
567
|
+
initSym2Raw(
|
|
568
|
+
2048,
|
|
569
|
+
FlipS2R,
|
|
570
|
+
FlipR2S,
|
|
571
|
+
SymStateFlip = initDim(C_classLit, $intern_26, 0, 336, 7, 1),
|
|
572
|
+
0
|
|
573
|
+
);
|
|
574
|
+
initSym2Raw(
|
|
575
|
+
2187,
|
|
576
|
+
TwistS2R,
|
|
577
|
+
TwistR2S,
|
|
578
|
+
SymStateTwist = initDim(C_classLit, $intern_26, 0, 324, 7, 1),
|
|
579
|
+
1
|
|
580
|
+
);
|
|
581
|
+
initFlipMove();
|
|
582
|
+
initTwistMove();
|
|
583
|
+
initUDSliceMoveConj();
|
|
584
|
+
}
|
|
585
|
+
initRawSymPrun(
|
|
586
|
+
MCPermPrun,
|
|
587
|
+
MPermMove,
|
|
588
|
+
MPermConj,
|
|
589
|
+
CPermMove,
|
|
590
|
+
($clinit_CubieCube(), SymStatePerm),
|
|
591
|
+
584244,
|
|
592
|
+
fullInit
|
|
593
|
+
);
|
|
594
|
+
initRawSymPrun(
|
|
595
|
+
EPermCCombPPrun,
|
|
596
|
+
CCombPMove,
|
|
597
|
+
CCombPConj,
|
|
598
|
+
EPermMove,
|
|
599
|
+
SymStatePerm,
|
|
600
|
+
514084,
|
|
601
|
+
fullInit
|
|
602
|
+
);
|
|
603
|
+
initRawSymPrun(
|
|
604
|
+
UDSliceTwistPrun,
|
|
605
|
+
UDSliceMove,
|
|
606
|
+
UDSliceConj,
|
|
607
|
+
TwistMove,
|
|
608
|
+
SymStateTwist,
|
|
609
|
+
431619,
|
|
610
|
+
fullInit
|
|
611
|
+
);
|
|
612
|
+
initRawSymPrun(
|
|
613
|
+
UDSliceFlipPrun,
|
|
614
|
+
UDSliceMove,
|
|
615
|
+
UDSliceConj,
|
|
616
|
+
FlipMove,
|
|
617
|
+
SymStateFlip,
|
|
618
|
+
431619,
|
|
619
|
+
fullInit
|
|
620
|
+
);
|
|
621
|
+
initRawSymPrun(
|
|
622
|
+
TwistFlipPrun,
|
|
623
|
+
null,
|
|
624
|
+
null,
|
|
625
|
+
TwistMove,
|
|
626
|
+
SymStateTwist,
|
|
627
|
+
103939,
|
|
628
|
+
fullInit
|
|
629
|
+
);
|
|
630
|
+
initLevel = fullInit ? 2 : 1;
|
|
631
|
+
}
|
|
632
|
+
function initCPermMove() {
|
|
633
|
+
var c;
|
|
634
|
+
var d;
|
|
635
|
+
var i;
|
|
636
|
+
var j;
|
|
637
|
+
c = new CubieCube();
|
|
638
|
+
d = new CubieCube();
|
|
639
|
+
for (i = 0; i < 2768; i++) {
|
|
640
|
+
$setCPerm(c, ($clinit_CubieCube(), EPermS2R)[i]);
|
|
641
|
+
for (j = 0; j < 10; j++) {
|
|
642
|
+
CornMult(c, moveCube[($clinit_Util(), ud2std)[j]], d);
|
|
643
|
+
CPermMove[i][j] = ESym2CSym(EPermR2S[getNPerm(d.ca, 8, false)]) & $intern_20;
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
function initCombPMoveConj() {
|
|
648
|
+
var c;
|
|
649
|
+
var d;
|
|
650
|
+
var i;
|
|
651
|
+
var j;
|
|
652
|
+
var j0;
|
|
653
|
+
c = new CubieCube();
|
|
654
|
+
d = new CubieCube();
|
|
655
|
+
CCombPMove = initDims(
|
|
656
|
+
C_classLit,
|
|
657
|
+
[$intern_3, $intern_26],
|
|
658
|
+
[11, 0],
|
|
659
|
+
7,
|
|
660
|
+
[140, 10],
|
|
661
|
+
2
|
|
662
|
+
);
|
|
663
|
+
for (i = 0; i < 140; i++) {
|
|
664
|
+
setComb(c.ca, i % 70, 0, false);
|
|
665
|
+
for (j0 = 0; j0 < 10; j0++) {
|
|
666
|
+
CornMult(
|
|
667
|
+
c,
|
|
668
|
+
($clinit_CubieCube(), moveCube)[($clinit_Util(), ud2std)[j0]],
|
|
669
|
+
d
|
|
670
|
+
);
|
|
671
|
+
CCombPMove[i][j0] = getComb(d.ca, 0, false) + 70 * (165 >> j0 & 1 ^ ~~(i / 70)) & $intern_20;
|
|
672
|
+
}
|
|
673
|
+
for (j = 0; j < 16; j++) {
|
|
674
|
+
CornConjugate(c, ($clinit_CubieCube(), SymMultInv)[0][j], d);
|
|
675
|
+
CCombPConj[i][j] = getComb(d.ca, 0, false) + 70 * ~~(i / 70) & $intern_20;
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
function initEPermMove() {
|
|
680
|
+
var c;
|
|
681
|
+
var d;
|
|
682
|
+
var i;
|
|
683
|
+
var j;
|
|
684
|
+
c = new CubieCube();
|
|
685
|
+
d = new CubieCube();
|
|
686
|
+
for (i = 0; i < 2768; i++) {
|
|
687
|
+
$setEPerm(c, ($clinit_CubieCube(), EPermS2R)[i]);
|
|
688
|
+
for (j = 0; j < 10; j++) {
|
|
689
|
+
EdgeMult(c, moveCube[($clinit_Util(), ud2std)[j]], d);
|
|
690
|
+
EPermMove[i][j] = EPermR2S[getNPerm(d.ea, 8, true)];
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
function initFlipMove() {
|
|
695
|
+
var c;
|
|
696
|
+
var d;
|
|
697
|
+
var i;
|
|
698
|
+
var j;
|
|
699
|
+
c = new CubieCube();
|
|
700
|
+
d = new CubieCube();
|
|
701
|
+
for (i = 0; i < 336; i++) {
|
|
702
|
+
$setFlip(c, ($clinit_CubieCube(), FlipS2R)[i]);
|
|
703
|
+
for (j = 0; j < 18; j++) {
|
|
704
|
+
EdgeMult(c, moveCube[j], d);
|
|
705
|
+
FlipMove[i][j] = FlipR2S[$getFlip(d)];
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
function initMPermMoveConj() {
|
|
710
|
+
var c;
|
|
711
|
+
var d;
|
|
712
|
+
var i;
|
|
713
|
+
var j;
|
|
714
|
+
var j0;
|
|
715
|
+
c = new CubieCube();
|
|
716
|
+
d = new CubieCube();
|
|
717
|
+
for (i = 0; i < 24; i++) {
|
|
718
|
+
setNPerm(c.ea, i, 12, true);
|
|
719
|
+
for (j0 = 0; j0 < 10; j0++) {
|
|
720
|
+
EdgeMult(
|
|
721
|
+
c,
|
|
722
|
+
($clinit_CubieCube(), moveCube)[($clinit_Util(), ud2std)[j0]],
|
|
723
|
+
d
|
|
724
|
+
);
|
|
725
|
+
MPermMove[i][j0] = getNPerm(d.ea, 12, true) % 24 & $intern_20;
|
|
726
|
+
}
|
|
727
|
+
for (j = 0; j < 16; j++) {
|
|
728
|
+
EdgeConjugate(c, ($clinit_CubieCube(), SymMultInv)[0][j], d);
|
|
729
|
+
MPermConj[i][j] = getNPerm(d.ea, 12, true) % 24 & $intern_20;
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
function initRawSymPrun(PrunTable, RawMove, RawConj, SymMove, SymState, PrunFlag, fullInit) {
|
|
734
|
+
var INV_DEPTH;
|
|
735
|
+
var ISTFP;
|
|
736
|
+
var IS_PHASE2;
|
|
737
|
+
var MAX_DEPTH;
|
|
738
|
+
var MIN_DEPTH;
|
|
739
|
+
var NEXT_AXIS_MAGIC;
|
|
740
|
+
var N_MOVES;
|
|
741
|
+
var N_RAW;
|
|
742
|
+
var N_SIZE;
|
|
743
|
+
var SEARCH_DEPTH;
|
|
744
|
+
var SYM_E2C_MAGIC;
|
|
745
|
+
var SYM_MASK;
|
|
746
|
+
var SYM_SHIFT;
|
|
747
|
+
var check;
|
|
748
|
+
var depth;
|
|
749
|
+
var flip;
|
|
750
|
+
var fsym;
|
|
751
|
+
var i;
|
|
752
|
+
var i0;
|
|
753
|
+
var idx;
|
|
754
|
+
var idxx;
|
|
755
|
+
var inv;
|
|
756
|
+
var j;
|
|
757
|
+
var m;
|
|
758
|
+
var mask;
|
|
759
|
+
var prun;
|
|
760
|
+
var raw;
|
|
761
|
+
var rawx;
|
|
762
|
+
var selArrMask;
|
|
763
|
+
var select;
|
|
764
|
+
var sym;
|
|
765
|
+
var symState;
|
|
766
|
+
var symx;
|
|
767
|
+
var val;
|
|
768
|
+
var val0;
|
|
769
|
+
var xorVal;
|
|
770
|
+
SYM_SHIFT = PrunFlag & 15;
|
|
771
|
+
SYM_E2C_MAGIC = (PrunFlag >> 4 & 1) === 1 ? $intern_28 : 0;
|
|
772
|
+
IS_PHASE2 = (PrunFlag >> 5 & 1) === 1;
|
|
773
|
+
INV_DEPTH = PrunFlag >> 8 & 15;
|
|
774
|
+
MAX_DEPTH = PrunFlag >> 12 & 15;
|
|
775
|
+
MIN_DEPTH = PrunFlag >> 16 & 15;
|
|
776
|
+
SEARCH_DEPTH = fullInit ? MAX_DEPTH : MIN_DEPTH;
|
|
777
|
+
SYM_MASK = (1 << SYM_SHIFT) - 1;
|
|
778
|
+
ISTFP = RawMove === null;
|
|
779
|
+
N_RAW = ISTFP ? 2048 : RawMove.length;
|
|
780
|
+
N_SIZE = N_RAW * SymMove.length;
|
|
781
|
+
N_MOVES = IS_PHASE2 ? 10 : 18;
|
|
782
|
+
NEXT_AXIS_MAGIC = N_MOVES === 10 ? 66 : 599186;
|
|
783
|
+
depth = (PrunTable[N_SIZE >> 3] >> (N_SIZE << 2) & 15) - 1;
|
|
784
|
+
if (depth === -1) {
|
|
785
|
+
for (i = 0; i < ~~(N_SIZE / 8) + 1; i++) {
|
|
786
|
+
PrunTable[i] = $intern_29;
|
|
787
|
+
}
|
|
788
|
+
PrunTable[0] ^= 1;
|
|
789
|
+
depth = 0;
|
|
790
|
+
}
|
|
791
|
+
while (depth < SEARCH_DEPTH) {
|
|
792
|
+
mask = (depth + 1) * $intern_29 ^ -1;
|
|
793
|
+
for (i0 = 0; i0 < PrunTable.length; i0++) {
|
|
794
|
+
val0 = PrunTable[i0] ^ mask;
|
|
795
|
+
val0 &= val0 >> 1;
|
|
796
|
+
PrunTable[i0] += val0 & val0 >> 2 & $intern_29;
|
|
797
|
+
}
|
|
798
|
+
inv = depth > INV_DEPTH;
|
|
799
|
+
select = inv ? depth + 2 : depth;
|
|
800
|
+
selArrMask = select * $intern_29;
|
|
801
|
+
check = inv ? depth : depth + 2;
|
|
802
|
+
++depth;
|
|
803
|
+
xorVal = depth ^ depth + 1;
|
|
804
|
+
val = 0;
|
|
805
|
+
for (i = 0; i < N_SIZE; ++i, val >>= 4) {
|
|
806
|
+
if ((i & 7) === 0) {
|
|
807
|
+
val = PrunTable[i >> 3];
|
|
808
|
+
if (((val ^ selArrMask) - $intern_29 & ~(val ^ selArrMask) & -2004318072) === 0) {
|
|
809
|
+
i += 7;
|
|
810
|
+
continue;
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
if ((val & 15) !== select) {
|
|
814
|
+
continue;
|
|
815
|
+
}
|
|
816
|
+
raw = i % N_RAW;
|
|
817
|
+
sym = ~~(i / N_RAW);
|
|
818
|
+
flip = 0;
|
|
819
|
+
fsym = 0;
|
|
820
|
+
if (ISTFP) {
|
|
821
|
+
flip = ($clinit_CubieCube(), FlipR2S)[raw];
|
|
822
|
+
fsym = flip & 7;
|
|
823
|
+
flip >>= 3;
|
|
824
|
+
}
|
|
825
|
+
for (m = 0; m < N_MOVES; m++) {
|
|
826
|
+
symx = SymMove[sym][m];
|
|
827
|
+
ISTFP ? rawx = ($clinit_CubieCube(), FlipS2RF)[FlipMove[flip][Sym8Move[m << 3 | fsym]] ^ fsym ^ symx & SYM_MASK] : rawx = RawConj[RawMove[raw][m]][symx & SYM_MASK];
|
|
828
|
+
symx >>= SYM_SHIFT;
|
|
829
|
+
idx = symx * N_RAW + rawx;
|
|
830
|
+
prun = PrunTable[idx >> 3] >> (idx << 2) & 15;
|
|
831
|
+
if (prun !== check) {
|
|
832
|
+
prun < depth - 1 && (m += NEXT_AXIS_MAGIC >> m & 3);
|
|
833
|
+
continue;
|
|
834
|
+
}
|
|
835
|
+
if (inv) {
|
|
836
|
+
PrunTable[i >> 3] ^= xorVal << (i << 2);
|
|
837
|
+
break;
|
|
838
|
+
}
|
|
839
|
+
PrunTable[idx >> 3] ^= xorVal << (idx << 2);
|
|
840
|
+
for (j = 1, symState = SymState[symx]; (symState >>= 1) !== 0; j++) {
|
|
841
|
+
if ((symState & 1) !== 1) {
|
|
842
|
+
continue;
|
|
843
|
+
}
|
|
844
|
+
idxx = symx * N_RAW;
|
|
845
|
+
ISTFP ? idxx += ($clinit_CubieCube(), FlipS2RF)[FlipR2S[rawx] ^ j] : idxx += RawConj[rawx][j ^ SYM_E2C_MAGIC >> (j << 1) & 3];
|
|
846
|
+
if ((PrunTable[idxx >> 3] >> (idxx << 2) & 15) === check) {
|
|
847
|
+
PrunTable[idxx >> 3] ^= xorVal << (idxx << 2);
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
function initTwistMove() {
|
|
855
|
+
var c;
|
|
856
|
+
var d;
|
|
857
|
+
var i;
|
|
858
|
+
var j;
|
|
859
|
+
c = new CubieCube();
|
|
860
|
+
d = new CubieCube();
|
|
861
|
+
for (i = 0; i < 324; i++) {
|
|
862
|
+
$setTwist(c, ($clinit_CubieCube(), TwistS2R)[i]);
|
|
863
|
+
for (j = 0; j < 18; j++) {
|
|
864
|
+
CornMult(c, moveCube[j], d);
|
|
865
|
+
TwistMove[i][j] = TwistR2S[$getTwist(d)];
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
function initUDSliceMoveConj() {
|
|
870
|
+
var c;
|
|
871
|
+
var d;
|
|
872
|
+
var i;
|
|
873
|
+
var i0;
|
|
874
|
+
var j;
|
|
875
|
+
var j0;
|
|
876
|
+
var k;
|
|
877
|
+
var udslice;
|
|
878
|
+
c = new CubieCube();
|
|
879
|
+
d = new CubieCube();
|
|
880
|
+
for (i0 = 0; i0 < 495; i0++) {
|
|
881
|
+
setComb(c.ea, 494 - i0, 8, true);
|
|
882
|
+
for (j0 = 0; j0 < 18; j0 += 3) {
|
|
883
|
+
EdgeMult(c, ($clinit_CubieCube(), moveCube)[j0], d);
|
|
884
|
+
UDSliceMove[i0][j0] = 494 - getComb(d.ea, 8, true) & $intern_20;
|
|
885
|
+
}
|
|
886
|
+
for (j = 0; j < 16; j += 2) {
|
|
887
|
+
EdgeConjugate(c, ($clinit_CubieCube(), SymMultInv)[0][j], d);
|
|
888
|
+
UDSliceConj[i0][j >> 1] = 494 - getComb(d.ea, 8, true) & $intern_20;
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
for (i = 0; i < 495; i++) {
|
|
892
|
+
for (j = 0; j < 18; j += 3) {
|
|
893
|
+
udslice = UDSliceMove[i][j];
|
|
894
|
+
for (k = 1; k < 3; k++) {
|
|
895
|
+
udslice = UDSliceMove[udslice][j];
|
|
896
|
+
UDSliceMove[i][j + k] = udslice & $intern_20;
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
defineClass(31, 1, { 31: 1 }, CoordCube);
|
|
902
|
+
_.flip = 0;
|
|
903
|
+
_.flipc = 0;
|
|
904
|
+
_.fsym = 0;
|
|
905
|
+
_.prun = 0;
|
|
906
|
+
_.slice_0 = 0;
|
|
907
|
+
_.tsym = 0;
|
|
908
|
+
_.twist = 0;
|
|
909
|
+
_.twistc = 0;
|
|
910
|
+
var CCombPConj;
|
|
911
|
+
var CCombPMove;
|
|
912
|
+
var CPermMove;
|
|
913
|
+
var EPermCCombPPrun;
|
|
914
|
+
var EPermMove;
|
|
915
|
+
var FlipMove;
|
|
916
|
+
var MCPermPrun;
|
|
917
|
+
var MPermConj;
|
|
918
|
+
var MPermMove;
|
|
919
|
+
var TwistFlipPrun;
|
|
920
|
+
var TwistMove;
|
|
921
|
+
var UDSliceConj;
|
|
922
|
+
var UDSliceFlipPrun;
|
|
923
|
+
var UDSliceMove;
|
|
924
|
+
var UDSliceTwistPrun;
|
|
925
|
+
var initLevel = 0;
|
|
926
|
+
var Lorg_cubing_min2phase_client_CoordCube_2_classLit = createForClass(
|
|
927
|
+
"org.cubing.min2phase.client",
|
|
928
|
+
"CoordCube",
|
|
929
|
+
31
|
|
930
|
+
);
|
|
931
|
+
var $clinit_CubieCube_ran = false;
|
|
932
|
+
function $clinit_CubieCube() {
|
|
933
|
+
if ($clinit_CubieCube_ran) {
|
|
934
|
+
return;
|
|
935
|
+
}
|
|
936
|
+
$clinit_CubieCube_ran = true;
|
|
937
|
+
CubeSym = initDim(
|
|
938
|
+
Lorg_cubing_min2phase_client_CubieCube_2_classLit,
|
|
939
|
+
$intern_3,
|
|
940
|
+
7,
|
|
941
|
+
16,
|
|
942
|
+
0,
|
|
943
|
+
1
|
|
944
|
+
);
|
|
945
|
+
moveCube = initDim(
|
|
946
|
+
Lorg_cubing_min2phase_client_CubieCube_2_classLit,
|
|
947
|
+
$intern_3,
|
|
948
|
+
7,
|
|
949
|
+
18,
|
|
950
|
+
0,
|
|
951
|
+
1
|
|
952
|
+
);
|
|
953
|
+
moveCubeSym = initDim(J_classLit, $intern_3, 0, 18, 6, 1);
|
|
954
|
+
firstMoveSym = initDim(I_classLit, $intern_27, 0, 48, 7, 1);
|
|
955
|
+
SymMult = initDims(
|
|
956
|
+
I_classLit,
|
|
957
|
+
[$intern_3, $intern_27],
|
|
958
|
+
[17, 0],
|
|
959
|
+
7,
|
|
960
|
+
[16, 16],
|
|
961
|
+
2
|
|
962
|
+
);
|
|
963
|
+
SymMultInv = initDims(
|
|
964
|
+
I_classLit,
|
|
965
|
+
[$intern_3, $intern_27],
|
|
966
|
+
[17, 0],
|
|
967
|
+
7,
|
|
968
|
+
[16, 16],
|
|
969
|
+
2
|
|
970
|
+
);
|
|
971
|
+
SymMove_0 = initDims(
|
|
972
|
+
I_classLit,
|
|
973
|
+
[$intern_3, $intern_27],
|
|
974
|
+
[17, 0],
|
|
975
|
+
7,
|
|
976
|
+
[16, 18],
|
|
977
|
+
2
|
|
978
|
+
);
|
|
979
|
+
Sym8Move = initDim(I_classLit, $intern_27, 0, 144, 7, 1);
|
|
980
|
+
SymMoveUD = initDims(
|
|
981
|
+
I_classLit,
|
|
982
|
+
[$intern_3, $intern_27],
|
|
983
|
+
[17, 0],
|
|
984
|
+
7,
|
|
985
|
+
[16, 18],
|
|
986
|
+
2
|
|
987
|
+
);
|
|
988
|
+
FlipS2R = initDim(C_classLit, $intern_26, 0, 336, 7, 1);
|
|
989
|
+
TwistS2R = initDim(C_classLit, $intern_26, 0, 324, 7, 1);
|
|
990
|
+
EPermS2R = initDim(C_classLit, $intern_26, 0, 2768, 7, 1);
|
|
991
|
+
Perm2CombP = initDim(B_classLit, $intern_30, 0, 2768, 7, 1);
|
|
992
|
+
PermInvEdgeSym = initDim(C_classLit, $intern_26, 0, 2768, 7, 1);
|
|
993
|
+
MPermInv = initDim(B_classLit, $intern_30, 0, 24, 7, 1);
|
|
994
|
+
FlipR2S = initDim(C_classLit, $intern_26, 0, 2048, 7, 1);
|
|
995
|
+
TwistR2S = initDim(C_classLit, $intern_26, 0, 2187, 7, 1);
|
|
996
|
+
EPermR2S = initDim(C_classLit, $intern_26, 0, 40320, 7, 1);
|
|
997
|
+
FlipS2RF = initDim(C_classLit, $intern_26, 0, 2688, 7, 1);
|
|
998
|
+
urf1 = new CubieCube_0(2531, 1373, 67026819, 1367);
|
|
999
|
+
urf2 = new CubieCube_0(2089, 1906, 322752913, 2040);
|
|
1000
|
+
urfMove = initValues(
|
|
1001
|
+
getClassLiteralForArray(B_classLit, 2),
|
|
1002
|
+
$intern_3,
|
|
1003
|
+
10,
|
|
1004
|
+
0,
|
|
1005
|
+
[
|
|
1006
|
+
initValues(
|
|
1007
|
+
getClassLiteralForArray(B_classLit, 1),
|
|
1008
|
+
$intern_30,
|
|
1009
|
+
0,
|
|
1010
|
+
7,
|
|
1011
|
+
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
|
|
1012
|
+
),
|
|
1013
|
+
initValues(
|
|
1014
|
+
getClassLiteralForArray(B_classLit, 1),
|
|
1015
|
+
$intern_30,
|
|
1016
|
+
0,
|
|
1017
|
+
7,
|
|
1018
|
+
[6, 7, 8, 0, 1, 2, 3, 4, 5, 15, 16, 17, 9, 10, 11, 12, 13, 14]
|
|
1019
|
+
),
|
|
1020
|
+
initValues(
|
|
1021
|
+
getClassLiteralForArray(B_classLit, 1),
|
|
1022
|
+
$intern_30,
|
|
1023
|
+
0,
|
|
1024
|
+
7,
|
|
1025
|
+
[3, 4, 5, 6, 7, 8, 0, 1, 2, 12, 13, 14, 15, 16, 17, 9, 10, 11]
|
|
1026
|
+
),
|
|
1027
|
+
initValues(
|
|
1028
|
+
getClassLiteralForArray(B_classLit, 1),
|
|
1029
|
+
$intern_30,
|
|
1030
|
+
0,
|
|
1031
|
+
7,
|
|
1032
|
+
[2, 1, 0, 5, 4, 3, 8, 7, 6, 11, 10, 9, 14, 13, 12, 17, 16, 15]
|
|
1033
|
+
),
|
|
1034
|
+
initValues(
|
|
1035
|
+
getClassLiteralForArray(B_classLit, 1),
|
|
1036
|
+
$intern_30,
|
|
1037
|
+
0,
|
|
1038
|
+
7,
|
|
1039
|
+
[8, 7, 6, 2, 1, 0, 5, 4, 3, 17, 16, 15, 11, 10, 9, 14, 13, 12]
|
|
1040
|
+
),
|
|
1041
|
+
initValues(
|
|
1042
|
+
getClassLiteralForArray(B_classLit, 1),
|
|
1043
|
+
$intern_30,
|
|
1044
|
+
0,
|
|
1045
|
+
7,
|
|
1046
|
+
[5, 4, 3, 8, 7, 6, 2, 1, 0, 14, 13, 12, 17, 16, 15, 11, 10, 9]
|
|
1047
|
+
)
|
|
1048
|
+
]
|
|
1049
|
+
);
|
|
1050
|
+
initMove();
|
|
1051
|
+
initSym();
|
|
1052
|
+
}
|
|
1053
|
+
function $$init(this$static) {
|
|
1054
|
+
this$static.ca = initValues(
|
|
1055
|
+
getClassLiteralForArray(B_classLit, 1),
|
|
1056
|
+
$intern_30,
|
|
1057
|
+
0,
|
|
1058
|
+
7,
|
|
1059
|
+
[0, 1, 2, 3, 4, 5, 6, 7]
|
|
1060
|
+
);
|
|
1061
|
+
this$static.ea = initValues(
|
|
1062
|
+
getClassLiteralForArray(B_classLit, 1),
|
|
1063
|
+
$intern_30,
|
|
1064
|
+
0,
|
|
1065
|
+
7,
|
|
1066
|
+
[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22]
|
|
1067
|
+
);
|
|
1068
|
+
}
|
|
1069
|
+
function $URFConjugate(this$static) {
|
|
1070
|
+
!this$static.temps && (this$static.temps = new CubieCube());
|
|
1071
|
+
CornMult(urf2, this$static, this$static.temps);
|
|
1072
|
+
CornMult(this$static.temps, urf1, this$static);
|
|
1073
|
+
EdgeMult(urf2, this$static, this$static.temps);
|
|
1074
|
+
EdgeMult(this$static.temps, urf1, this$static);
|
|
1075
|
+
}
|
|
1076
|
+
function $copy(this$static, c) {
|
|
1077
|
+
var i;
|
|
1078
|
+
var i0;
|
|
1079
|
+
for (i0 = 0; i0 < 8; i0++) {
|
|
1080
|
+
this$static.ca[i0] = c.ca[i0];
|
|
1081
|
+
}
|
|
1082
|
+
for (i = 0; i < 12; i++) {
|
|
1083
|
+
this$static.ea[i] = c.ea[i];
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
function $getCPermSym(this$static) {
|
|
1087
|
+
return ESym2CSym(EPermR2S[getNPerm(this$static.ca, 8, false)]);
|
|
1088
|
+
}
|
|
1089
|
+
function $getEPermSym(this$static) {
|
|
1090
|
+
return EPermR2S[getNPerm(this$static.ea, 8, true)];
|
|
1091
|
+
}
|
|
1092
|
+
function $getFlip(this$static) {
|
|
1093
|
+
var i;
|
|
1094
|
+
var idx;
|
|
1095
|
+
idx = 0;
|
|
1096
|
+
for (i = 0; i < 11; i++) {
|
|
1097
|
+
idx = idx << 1 | this$static.ea[i] & 1;
|
|
1098
|
+
}
|
|
1099
|
+
return idx;
|
|
1100
|
+
}
|
|
1101
|
+
function $getTwist(this$static) {
|
|
1102
|
+
var i;
|
|
1103
|
+
var idx;
|
|
1104
|
+
idx = 0;
|
|
1105
|
+
for (i = 0; i < 7; i++) {
|
|
1106
|
+
idx += (idx << 1) + (this$static.ca[i] >> 3);
|
|
1107
|
+
}
|
|
1108
|
+
return idx;
|
|
1109
|
+
}
|
|
1110
|
+
function $invCubieCube(this$static) {
|
|
1111
|
+
var corn;
|
|
1112
|
+
var edge;
|
|
1113
|
+
!this$static.temps && (this$static.temps = new CubieCube());
|
|
1114
|
+
for (edge = 0; edge < 12; edge++) {
|
|
1115
|
+
this$static.temps.ea[this$static.ea[edge] >> 1] = (edge << 1 | this$static.ea[edge] & 1) << 24 >> 24;
|
|
1116
|
+
}
|
|
1117
|
+
for (corn = 0; corn < 8; corn++) {
|
|
1118
|
+
this$static.temps.ca[this$static.ca[corn] & 7] = (corn | 32 >> (this$static.ca[corn] >> 3) & 24) << 24 >> 24;
|
|
1119
|
+
}
|
|
1120
|
+
$copy(this$static, this$static.temps);
|
|
1121
|
+
}
|
|
1122
|
+
function $selfSymmetry(this$static) {
|
|
1123
|
+
var c;
|
|
1124
|
+
var cperm;
|
|
1125
|
+
var cpermx;
|
|
1126
|
+
var d;
|
|
1127
|
+
var i;
|
|
1128
|
+
var sym;
|
|
1129
|
+
var urfInv;
|
|
1130
|
+
c = new CubieCube_1(this$static);
|
|
1131
|
+
d = new CubieCube();
|
|
1132
|
+
cperm = ESym2CSym(EPermR2S[getNPerm(c.ca, 8, false)]) >> 4;
|
|
1133
|
+
sym = { l: 0, m: 0, h: 0 };
|
|
1134
|
+
for (urfInv = 0; urfInv < 6; urfInv++) {
|
|
1135
|
+
cpermx = ESym2CSym(EPermR2S[getNPerm(c.ca, 8, false)]) >> 4;
|
|
1136
|
+
if (cperm === cpermx) {
|
|
1137
|
+
for (i = 0; i < 16; i++) {
|
|
1138
|
+
CornConjugate(c, SymMultInv[0][i], d);
|
|
1139
|
+
if (equals_7(d.ca, this$static.ca)) {
|
|
1140
|
+
EdgeConjugate(c, SymMultInv[0][i], d);
|
|
1141
|
+
equals_7(d.ea, this$static.ea) && (sym = or(
|
|
1142
|
+
sym,
|
|
1143
|
+
shl(
|
|
1144
|
+
{ l: 1, m: 0, h: 0 },
|
|
1145
|
+
(urfInv << 4 | i) < 48 ? urfInv << 4 | i : 48
|
|
1146
|
+
)
|
|
1147
|
+
));
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
$URFConjugate(c);
|
|
1152
|
+
urfInv % 3 === 2 && $invCubieCube(c);
|
|
1153
|
+
}
|
|
1154
|
+
return sym;
|
|
1155
|
+
}
|
|
1156
|
+
function $setCPerm(this$static, idx) {
|
|
1157
|
+
setNPerm(this$static.ca, idx, 8, false);
|
|
1158
|
+
}
|
|
1159
|
+
function $setEPerm(this$static, idx) {
|
|
1160
|
+
setNPerm(this$static.ea, idx, 8, true);
|
|
1161
|
+
}
|
|
1162
|
+
function $setFlip(this$static, idx) {
|
|
1163
|
+
var i;
|
|
1164
|
+
var parity;
|
|
1165
|
+
var val;
|
|
1166
|
+
parity = 0;
|
|
1167
|
+
for (i = 10; i >= 0; --i, idx >>= 1) {
|
|
1168
|
+
parity ^= val = idx & 1;
|
|
1169
|
+
this$static.ea[i] = (this$static.ea[i] & -2 | val) << 24 >> 24;
|
|
1170
|
+
}
|
|
1171
|
+
this$static.ea[11] = (this$static.ea[11] & -2 | parity) << 24 >> 24;
|
|
1172
|
+
}
|
|
1173
|
+
function $setTwist(this$static, idx) {
|
|
1174
|
+
var i;
|
|
1175
|
+
var twst;
|
|
1176
|
+
var val;
|
|
1177
|
+
twst = 15;
|
|
1178
|
+
for (i = 6; i >= 0; --i, idx = ~~(idx / 3)) {
|
|
1179
|
+
twst -= val = idx % 3;
|
|
1180
|
+
this$static.ca[i] = (this$static.ca[i] & 7 | val << 3) << 24 >> 24;
|
|
1181
|
+
}
|
|
1182
|
+
this$static.ca[7] = (this$static.ca[7] & 7 | twst % 3 << 3) << 24 >> 24;
|
|
1183
|
+
}
|
|
1184
|
+
function $verify(this$static) {
|
|
1185
|
+
var c;
|
|
1186
|
+
var cornMask;
|
|
1187
|
+
var e;
|
|
1188
|
+
var edgeMask;
|
|
1189
|
+
var sum;
|
|
1190
|
+
sum = 0;
|
|
1191
|
+
edgeMask = 0;
|
|
1192
|
+
for (e = 0; e < 12; e++) {
|
|
1193
|
+
edgeMask |= 1 << (this$static.ea[e] >> 1);
|
|
1194
|
+
sum ^= this$static.ea[e] & 1;
|
|
1195
|
+
}
|
|
1196
|
+
if (edgeMask !== 4095) {
|
|
1197
|
+
return -2;
|
|
1198
|
+
}
|
|
1199
|
+
if (sum !== 0) {
|
|
1200
|
+
return -3;
|
|
1201
|
+
}
|
|
1202
|
+
cornMask = 0;
|
|
1203
|
+
sum = 0;
|
|
1204
|
+
for (c = 0; c < 8; c++) {
|
|
1205
|
+
cornMask |= 1 << (this$static.ca[c] & 7);
|
|
1206
|
+
sum += this$static.ca[c] >> 3;
|
|
1207
|
+
}
|
|
1208
|
+
if (cornMask !== 255) {
|
|
1209
|
+
return -4;
|
|
1210
|
+
}
|
|
1211
|
+
if (sum % 3 !== 0) {
|
|
1212
|
+
return -5;
|
|
1213
|
+
}
|
|
1214
|
+
if ((getNParity(getNPerm(this$static.ea, 12, true), 12) ^ getNParity(getNPerm(this$static.ca, 8, false), 8)) !== 0) {
|
|
1215
|
+
return -6;
|
|
1216
|
+
}
|
|
1217
|
+
return 0;
|
|
1218
|
+
}
|
|
1219
|
+
function CornConjugate(a, idx, b) {
|
|
1220
|
+
$clinit_CubieCube();
|
|
1221
|
+
var corn;
|
|
1222
|
+
var ori;
|
|
1223
|
+
var oriA;
|
|
1224
|
+
var oriB;
|
|
1225
|
+
var s;
|
|
1226
|
+
var sinv;
|
|
1227
|
+
sinv = CubeSym[SymMultInv[0][idx]];
|
|
1228
|
+
s = CubeSym[idx];
|
|
1229
|
+
for (corn = 0; corn < 8; corn++) {
|
|
1230
|
+
oriA = sinv.ca[a.ca[s.ca[corn] & 7] & 7] >> 3;
|
|
1231
|
+
oriB = a.ca[s.ca[corn] & 7] >> 3;
|
|
1232
|
+
ori = oriA < 3 ? oriB : (3 - oriB) % 3;
|
|
1233
|
+
b.ca[corn] = (sinv.ca[a.ca[s.ca[corn] & 7] & 7] & 7 | ori << 3) << 24 >> 24;
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
function CornMult(a, b, prod) {
|
|
1237
|
+
$clinit_CubieCube();
|
|
1238
|
+
var corn;
|
|
1239
|
+
var oriA;
|
|
1240
|
+
var oriB;
|
|
1241
|
+
for (corn = 0; corn < 8; corn++) {
|
|
1242
|
+
oriA = a.ca[b.ca[corn] & 7] >> 3;
|
|
1243
|
+
oriB = b.ca[corn] >> 3;
|
|
1244
|
+
prod.ca[corn] = (a.ca[b.ca[corn] & 7] & 7 | (oriA + oriB) % 3 << 3) << 24 >> 24;
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
function CornMultFull(a, b, prod) {
|
|
1248
|
+
var corn;
|
|
1249
|
+
var ori;
|
|
1250
|
+
var oriA;
|
|
1251
|
+
var oriB;
|
|
1252
|
+
for (corn = 0; corn < 8; corn++) {
|
|
1253
|
+
oriA = a.ca[b.ca[corn] & 7] >> 3;
|
|
1254
|
+
oriB = b.ca[corn] >> 3;
|
|
1255
|
+
ori = oriA + (oriA < 3 ? oriB : 6 - oriB);
|
|
1256
|
+
ori = ori % 3 + (oriA < 3 === oriB < 3 ? 0 : 3);
|
|
1257
|
+
prod.ca[corn] = (a.ca[b.ca[corn] & 7] & 7 | ori << 3) << 24 >> 24;
|
|
1258
|
+
}
|
|
1259
|
+
}
|
|
1260
|
+
function CubieCube() {
|
|
1261
|
+
$clinit_CubieCube();
|
|
1262
|
+
$$init(this);
|
|
1263
|
+
}
|
|
1264
|
+
function CubieCube_0(cperm, twist, eperm, flip) {
|
|
1265
|
+
$$init(this);
|
|
1266
|
+
setNPerm(this.ca, cperm, 8, false);
|
|
1267
|
+
$setTwist(this, twist);
|
|
1268
|
+
setNPerm(this.ea, eperm, 12, true);
|
|
1269
|
+
$setFlip(this, flip);
|
|
1270
|
+
}
|
|
1271
|
+
function CubieCube_1(c) {
|
|
1272
|
+
$$init(this);
|
|
1273
|
+
$copy(this, c);
|
|
1274
|
+
}
|
|
1275
|
+
function ESym2CSym(idx) {
|
|
1276
|
+
$clinit_CubieCube();
|
|
1277
|
+
return idx ^ $intern_28 >> ((idx & 15) << 1) & 3;
|
|
1278
|
+
}
|
|
1279
|
+
function EdgeConjugate(a, idx, b) {
|
|
1280
|
+
$clinit_CubieCube();
|
|
1281
|
+
var ed;
|
|
1282
|
+
var s;
|
|
1283
|
+
var sinv;
|
|
1284
|
+
sinv = CubeSym[SymMultInv[0][idx]];
|
|
1285
|
+
s = CubeSym[idx];
|
|
1286
|
+
for (ed = 0; ed < 12; ed++) {
|
|
1287
|
+
b.ea[ed] = (sinv.ea[a.ea[s.ea[ed] >> 1] >> 1] ^ a.ea[s.ea[ed] >> 1] & 1 ^ s.ea[ed] & 1) << 24 >> 24;
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
1290
|
+
function EdgeMult(a, b, prod) {
|
|
1291
|
+
$clinit_CubieCube();
|
|
1292
|
+
var ed;
|
|
1293
|
+
for (ed = 0; ed < 12; ed++) {
|
|
1294
|
+
prod.ea[ed] = (a.ea[b.ea[ed] >> 1] ^ b.ea[ed] & 1) << 24 >> 24;
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
function getPermSymInv(idx, sym, isCorner) {
|
|
1298
|
+
$clinit_CubieCube();
|
|
1299
|
+
var idxi;
|
|
1300
|
+
idxi = PermInvEdgeSym[idx];
|
|
1301
|
+
isCorner && (idxi = idxi ^ $intern_28 >> ((idxi & 15) << 1) & 3);
|
|
1302
|
+
return idxi & 65520 | SymMult[idxi & 15][sym];
|
|
1303
|
+
}
|
|
1304
|
+
function getSkipMoves() {
|
|
1305
|
+
$clinit_CubieCube();
|
|
1306
|
+
return 0;
|
|
1307
|
+
}
|
|
1308
|
+
function initMove() {
|
|
1309
|
+
var a;
|
|
1310
|
+
var p;
|
|
1311
|
+
moveCube[0] = new CubieCube_0(15120, 0, 119750400, 0);
|
|
1312
|
+
moveCube[3] = new CubieCube_0(21021, 1494, 323403417, 0);
|
|
1313
|
+
moveCube[6] = new CubieCube_0(8064, 1236, 29441808, 550);
|
|
1314
|
+
moveCube[9] = new CubieCube_0(9, 0, 5880, 0);
|
|
1315
|
+
moveCube[12] = new CubieCube_0(1230, 412, 2949660, 0);
|
|
1316
|
+
moveCube[15] = new CubieCube_0(224, 137, 328552, 137);
|
|
1317
|
+
for (a = 0; a < 18; a += 3) {
|
|
1318
|
+
for (p = 0; p < 2; p++) {
|
|
1319
|
+
moveCube[a + p + 1] = new CubieCube();
|
|
1320
|
+
EdgeMult(moveCube[a + p], moveCube[a], moveCube[a + p + 1]);
|
|
1321
|
+
CornMult(moveCube[a + p], moveCube[a], moveCube[a + p + 1]);
|
|
1322
|
+
}
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
function initPermSym2Raw() {
|
|
1326
|
+
$clinit_CubieCube();
|
|
1327
|
+
var cc;
|
|
1328
|
+
var i;
|
|
1329
|
+
var i0;
|
|
1330
|
+
initSym2Raw(
|
|
1331
|
+
40320,
|
|
1332
|
+
EPermS2R,
|
|
1333
|
+
EPermR2S,
|
|
1334
|
+
SymStatePerm = initDim(C_classLit, $intern_26, 0, 2768, 7, 1),
|
|
1335
|
+
2
|
|
1336
|
+
);
|
|
1337
|
+
cc = new CubieCube();
|
|
1338
|
+
for (i0 = 0; i0 < 2768; i0++) {
|
|
1339
|
+
$setEPerm(cc, EPermS2R[i0]);
|
|
1340
|
+
Perm2CombP[i0] = getComb(cc.ea, 0, true) + getNParity(EPermS2R[i0], 8) * 70 << 24 >> 24;
|
|
1341
|
+
$invCubieCube(cc);
|
|
1342
|
+
PermInvEdgeSym[i0] = EPermR2S[getNPerm(cc.ea, 8, true)];
|
|
1343
|
+
}
|
|
1344
|
+
for (i = 0; i < 24; i++) {
|
|
1345
|
+
setNPerm(cc.ea, i, 12, true);
|
|
1346
|
+
$invCubieCube(cc);
|
|
1347
|
+
MPermInv[i] = getNPerm(cc.ea, 12, true) % 24 << 24 >> 24;
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
function initSym() {
|
|
1351
|
+
var c;
|
|
1352
|
+
var d;
|
|
1353
|
+
var f2;
|
|
1354
|
+
var i;
|
|
1355
|
+
var i0;
|
|
1356
|
+
var i1;
|
|
1357
|
+
var i2;
|
|
1358
|
+
var j;
|
|
1359
|
+
var j0;
|
|
1360
|
+
var j1;
|
|
1361
|
+
var k;
|
|
1362
|
+
var lr2;
|
|
1363
|
+
var m;
|
|
1364
|
+
var s;
|
|
1365
|
+
var t;
|
|
1366
|
+
var u4;
|
|
1367
|
+
c = new CubieCube();
|
|
1368
|
+
d = new CubieCube();
|
|
1369
|
+
f2 = new CubieCube_0(28783, 0, 259268407, 0);
|
|
1370
|
+
u4 = new CubieCube_0(15138, 0, 119765538, 7);
|
|
1371
|
+
lr2 = new CubieCube_0(5167, 0, 83473207, 0);
|
|
1372
|
+
for (i0 = 0; i0 < 8; i0++) {
|
|
1373
|
+
lr2.ca[i0] = narrow_byte(lr2.ca[i0] | 24);
|
|
1374
|
+
}
|
|
1375
|
+
for (i1 = 0; i1 < 16; i1++) {
|
|
1376
|
+
CubeSym[i1] = new CubieCube_1(c);
|
|
1377
|
+
CornMultFull(c, u4, d);
|
|
1378
|
+
EdgeMult(c, u4, d);
|
|
1379
|
+
t = d;
|
|
1380
|
+
d = c;
|
|
1381
|
+
c = t;
|
|
1382
|
+
if (i1 % 4 === 3) {
|
|
1383
|
+
CornMultFull(t, lr2, d);
|
|
1384
|
+
EdgeMult(t, lr2, d);
|
|
1385
|
+
t = d;
|
|
1386
|
+
d = c;
|
|
1387
|
+
c = t;
|
|
1388
|
+
}
|
|
1389
|
+
if (i1 % 8 === 7) {
|
|
1390
|
+
CornMultFull(t, f2, d);
|
|
1391
|
+
EdgeMult(t, f2, d);
|
|
1392
|
+
t = d;
|
|
1393
|
+
d = c;
|
|
1394
|
+
c = t;
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1397
|
+
for (i2 = 0; i2 < 16; i2++) {
|
|
1398
|
+
for (j0 = 0; j0 < 16; j0++) {
|
|
1399
|
+
CornMultFull(CubeSym[i2], CubeSym[j0], c);
|
|
1400
|
+
for (k = 0; k < 16; k++) {
|
|
1401
|
+
if (equals_7(CubeSym[k].ca, c.ca)) {
|
|
1402
|
+
SymMult[i2][j0] = k;
|
|
1403
|
+
SymMultInv[k][j0] = i2;
|
|
1404
|
+
break;
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
for (j1 = 0; j1 < 18; j1++) {
|
|
1410
|
+
for (s = 0; s < 16; s++) {
|
|
1411
|
+
CornConjugate(moveCube[j1], SymMultInv[0][s], c);
|
|
1412
|
+
for (m = 0; m < 18; m++) {
|
|
1413
|
+
if (equals_7(moveCube[m].ca, c.ca)) {
|
|
1414
|
+
SymMove_0[s][j1] = m;
|
|
1415
|
+
SymMoveUD[s][($clinit_Util(), std2ud)[j1]] = std2ud[m];
|
|
1416
|
+
break;
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
s % 2 === 0 && (Sym8Move[j1 << 3 | s >> 1] = SymMove_0[s][j1]);
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1422
|
+
for (i = 0; i < 18; i++) {
|
|
1423
|
+
moveCubeSym[i] = $selfSymmetry(moveCube[i]);
|
|
1424
|
+
j = i;
|
|
1425
|
+
for (s = 0; s < 48; s++) {
|
|
1426
|
+
SymMove_0[s % 16][j] < i && (firstMoveSym[s] |= 1 << i);
|
|
1427
|
+
s % 16 === 15 && (j = urfMove[2][j]);
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1431
|
+
function initSym2Raw(N_RAW, Sym2Raw, Raw2Sym, SymState, coord) {
|
|
1432
|
+
$clinit_CubieCube();
|
|
1433
|
+
var c;
|
|
1434
|
+
var count;
|
|
1435
|
+
var d;
|
|
1436
|
+
var i;
|
|
1437
|
+
var idx;
|
|
1438
|
+
var isEdge;
|
|
1439
|
+
var s;
|
|
1440
|
+
var symIdx;
|
|
1441
|
+
var sym_inc;
|
|
1442
|
+
c = new CubieCube();
|
|
1443
|
+
d = new CubieCube();
|
|
1444
|
+
count = 0;
|
|
1445
|
+
idx = 0;
|
|
1446
|
+
sym_inc = coord >= 2 ? 1 : 2;
|
|
1447
|
+
isEdge = coord !== 1;
|
|
1448
|
+
for (i = 0; i < N_RAW; i++) {
|
|
1449
|
+
if (Raw2Sym[i] !== 0) {
|
|
1450
|
+
continue;
|
|
1451
|
+
}
|
|
1452
|
+
switch (coord) {
|
|
1453
|
+
case 0: {
|
|
1454
|
+
$setFlip(c, i);
|
|
1455
|
+
break;
|
|
1456
|
+
}
|
|
1457
|
+
case 1: {
|
|
1458
|
+
$setTwist(c, i);
|
|
1459
|
+
break;
|
|
1460
|
+
}
|
|
1461
|
+
case 2:
|
|
1462
|
+
setNPerm(c.ea, i, 8, true);
|
|
1463
|
+
}
|
|
1464
|
+
for (s = 0; s < 16; s += sym_inc) {
|
|
1465
|
+
isEdge ? EdgeConjugate(c, s, d) : CornConjugate(c, s, d);
|
|
1466
|
+
switch (coord) {
|
|
1467
|
+
case 0: {
|
|
1468
|
+
idx = $getFlip(d);
|
|
1469
|
+
break;
|
|
1470
|
+
}
|
|
1471
|
+
case 1: {
|
|
1472
|
+
idx = $getTwist(d);
|
|
1473
|
+
break;
|
|
1474
|
+
}
|
|
1475
|
+
case 2:
|
|
1476
|
+
idx = getNPerm(d.ea, 8, true);
|
|
1477
|
+
}
|
|
1478
|
+
coord === 0 && (FlipS2RF[count << 3 | s >> 1] = idx & $intern_20);
|
|
1479
|
+
idx === i && (SymState[count] = (SymState[count] | 1 << ~~(s / sym_inc)) & $intern_20);
|
|
1480
|
+
symIdx = ~~((count << 4 | s) / sym_inc);
|
|
1481
|
+
Raw2Sym[idx] = symIdx & $intern_20;
|
|
1482
|
+
}
|
|
1483
|
+
Sym2Raw[count++] = i & $intern_20;
|
|
1484
|
+
}
|
|
1485
|
+
return count;
|
|
1486
|
+
}
|
|
1487
|
+
var CubeSym;
|
|
1488
|
+
var EPermR2S;
|
|
1489
|
+
var EPermS2R;
|
|
1490
|
+
var FlipR2S;
|
|
1491
|
+
var FlipS2R;
|
|
1492
|
+
var FlipS2RF;
|
|
1493
|
+
var MPermInv;
|
|
1494
|
+
var Perm2CombP;
|
|
1495
|
+
var PermInvEdgeSym;
|
|
1496
|
+
var Sym8Move;
|
|
1497
|
+
var SymMove_0;
|
|
1498
|
+
var SymMoveUD;
|
|
1499
|
+
var SymMult;
|
|
1500
|
+
var SymMultInv;
|
|
1501
|
+
var SymStateFlip;
|
|
1502
|
+
var SymStatePerm;
|
|
1503
|
+
var SymStateTwist;
|
|
1504
|
+
var TwistR2S;
|
|
1505
|
+
var TwistS2R;
|
|
1506
|
+
var firstMoveSym;
|
|
1507
|
+
var moveCube;
|
|
1508
|
+
var moveCubeSym;
|
|
1509
|
+
var urf1;
|
|
1510
|
+
var urf2;
|
|
1511
|
+
var urfMove;
|
|
1512
|
+
var Lorg_cubing_min2phase_client_CubieCube_2_classLit = createForClass(
|
|
1513
|
+
"org.cubing.min2phase.client",
|
|
1514
|
+
"CubieCube",
|
|
1515
|
+
7
|
|
1516
|
+
);
|
|
1517
|
+
function $initPhase2(this$static, p2corn, p2csym, p2edge, p2esym, p2mid, edgei, corni) {
|
|
1518
|
+
var depth2;
|
|
1519
|
+
var i;
|
|
1520
|
+
var i0;
|
|
1521
|
+
var prun;
|
|
1522
|
+
var ret;
|
|
1523
|
+
prun = max_0(
|
|
1524
|
+
getPruning(
|
|
1525
|
+
($clinit_CoordCube(), EPermCCombPPrun),
|
|
1526
|
+
(edgei >> 4) * 140 + CCombPConj[($clinit_CubieCube(), Perm2CombP)[corni >> 4] & 255][SymMultInv[edgei & 15][corni & 15]]
|
|
1527
|
+
),
|
|
1528
|
+
max_0(
|
|
1529
|
+
getPruning(
|
|
1530
|
+
EPermCCombPPrun,
|
|
1531
|
+
p2edge * 140 + CCombPConj[Perm2CombP[p2corn] & 255][SymMultInv[p2esym][p2csym]]
|
|
1532
|
+
),
|
|
1533
|
+
getPruning(MCPermPrun, p2corn * 24 + MPermConj[p2mid][p2csym])
|
|
1534
|
+
)
|
|
1535
|
+
);
|
|
1536
|
+
if (prun > this$static.maxDep2) {
|
|
1537
|
+
return prun - this$static.maxDep2;
|
|
1538
|
+
}
|
|
1539
|
+
for (depth2 = this$static.maxDep2; depth2 >= prun; depth2--) {
|
|
1540
|
+
ret = $phase2(
|
|
1541
|
+
this$static,
|
|
1542
|
+
p2edge,
|
|
1543
|
+
p2esym,
|
|
1544
|
+
p2corn,
|
|
1545
|
+
p2csym,
|
|
1546
|
+
p2mid,
|
|
1547
|
+
depth2,
|
|
1548
|
+
this$static.depth1,
|
|
1549
|
+
10
|
|
1550
|
+
);
|
|
1551
|
+
if (ret < 0) {
|
|
1552
|
+
break;
|
|
1553
|
+
}
|
|
1554
|
+
depth2 -= ret;
|
|
1555
|
+
this$static.solLen = 0;
|
|
1556
|
+
this$static.solution = new Util$Solution();
|
|
1557
|
+
$setArgs(
|
|
1558
|
+
this$static.solution,
|
|
1559
|
+
this$static.verbose,
|
|
1560
|
+
this$static.urfIdx,
|
|
1561
|
+
this$static.depth1
|
|
1562
|
+
);
|
|
1563
|
+
for (i0 = 0; i0 < this$static.depth1 + depth2; i0++) {
|
|
1564
|
+
$appendSolMove(this$static.solution, this$static.move[i0]);
|
|
1565
|
+
}
|
|
1566
|
+
for (i = this$static.preMoveLen - 1; i >= 0; i--) {
|
|
1567
|
+
$appendSolMove(this$static.solution, this$static.preMoves[i]);
|
|
1568
|
+
}
|
|
1569
|
+
this$static.solLen = this$static.solution.length_0;
|
|
1570
|
+
}
|
|
1571
|
+
if (depth2 !== this$static.maxDep2) {
|
|
1572
|
+
this$static.maxDep2 = min_0(
|
|
1573
|
+
MAX_DEPTH2,
|
|
1574
|
+
this$static.solLen - this$static.length1 - 1
|
|
1575
|
+
);
|
|
1576
|
+
return gte(this$static.probe, this$static.probeMin) ? 0 : 1;
|
|
1577
|
+
}
|
|
1578
|
+
return 1;
|
|
1579
|
+
}
|
|
1580
|
+
function $initPhase2Pre(this$static) {
|
|
1581
|
+
var corni;
|
|
1582
|
+
var edgei;
|
|
1583
|
+
var i;
|
|
1584
|
+
var lastMove;
|
|
1585
|
+
var lastPre;
|
|
1586
|
+
var m;
|
|
1587
|
+
var p2corn;
|
|
1588
|
+
var p2csym;
|
|
1589
|
+
var p2edge;
|
|
1590
|
+
var p2esym;
|
|
1591
|
+
var p2mid;
|
|
1592
|
+
var p2switch;
|
|
1593
|
+
var p2switchMask;
|
|
1594
|
+
var p2switchMax;
|
|
1595
|
+
var ret;
|
|
1596
|
+
this$static.isRec = false;
|
|
1597
|
+
if (gte(
|
|
1598
|
+
this$static.probe,
|
|
1599
|
+
!this$static.solution ? this$static.probeMax : this$static.probeMin
|
|
1600
|
+
)) {
|
|
1601
|
+
return 0;
|
|
1602
|
+
}
|
|
1603
|
+
this$static.probe = add_1(this$static.probe, { l: 1, m: 0, h: 0 });
|
|
1604
|
+
for (i = this$static.valid1; i < this$static.depth1; i++) {
|
|
1605
|
+
CornMult(
|
|
1606
|
+
this$static.phase1Cubie[i],
|
|
1607
|
+
($clinit_CubieCube(), moveCube)[this$static.move[i]],
|
|
1608
|
+
this$static.phase1Cubie[i + 1]
|
|
1609
|
+
);
|
|
1610
|
+
EdgeMult(
|
|
1611
|
+
this$static.phase1Cubie[i],
|
|
1612
|
+
moveCube[this$static.move[i]],
|
|
1613
|
+
this$static.phase1Cubie[i + 1]
|
|
1614
|
+
);
|
|
1615
|
+
}
|
|
1616
|
+
this$static.valid1 = this$static.depth1;
|
|
1617
|
+
p2corn = $getCPermSym(this$static.phase1Cubie[this$static.depth1]);
|
|
1618
|
+
p2csym = p2corn & 15;
|
|
1619
|
+
p2corn >>= 4;
|
|
1620
|
+
p2edge = $getEPermSym(this$static.phase1Cubie[this$static.depth1]);
|
|
1621
|
+
p2esym = p2edge & 15;
|
|
1622
|
+
p2edge >>= 4;
|
|
1623
|
+
p2mid = getNPerm(this$static.phase1Cubie[this$static.depth1].ea, 12, true) % 24;
|
|
1624
|
+
edgei = getPermSymInv(p2edge, p2esym, false);
|
|
1625
|
+
corni = getPermSymInv(p2corn, p2csym, true);
|
|
1626
|
+
lastMove = this$static.depth1 === 0 ? -1 : this$static.move[this$static.depth1 - 1];
|
|
1627
|
+
lastPre = this$static.preMoveLen === 0 ? -1 : this$static.preMoves[this$static.preMoveLen - 1];
|
|
1628
|
+
ret = 0;
|
|
1629
|
+
p2switchMax = (this$static.preMoveLen === 0 ? 1 : 2) * (this$static.depth1 === 0 ? 1 : 2);
|
|
1630
|
+
for (p2switch = 0, p2switchMask = (1 << p2switchMax) - 1; p2switch < p2switchMax; p2switch++) {
|
|
1631
|
+
if ((p2switchMask >> p2switch & 1) !== 0) {
|
|
1632
|
+
p2switchMask &= ~(1 << p2switch);
|
|
1633
|
+
ret = $initPhase2(
|
|
1634
|
+
this$static,
|
|
1635
|
+
p2corn,
|
|
1636
|
+
p2csym,
|
|
1637
|
+
p2edge,
|
|
1638
|
+
p2esym,
|
|
1639
|
+
p2mid,
|
|
1640
|
+
edgei,
|
|
1641
|
+
corni
|
|
1642
|
+
);
|
|
1643
|
+
if (ret === 0 || ret > 2) {
|
|
1644
|
+
break;
|
|
1645
|
+
} else {
|
|
1646
|
+
ret === 2 && (p2switchMask &= 4 << p2switch);
|
|
1647
|
+
}
|
|
1648
|
+
}
|
|
1649
|
+
if (p2switchMask === 0) {
|
|
1650
|
+
break;
|
|
1651
|
+
}
|
|
1652
|
+
if ((p2switch & 1) === 0 && this$static.depth1 > 0) {
|
|
1653
|
+
m = ($clinit_Util(), std2ud)[~~(lastMove / 3) * 3 + 1];
|
|
1654
|
+
this$static.move[this$static.depth1 - 1] = ud2std[m] * 2 - this$static.move[this$static.depth1 - 1];
|
|
1655
|
+
p2mid = ($clinit_CoordCube(), MPermMove)[p2mid][m];
|
|
1656
|
+
p2corn = CPermMove[p2corn][($clinit_CubieCube(), SymMoveUD)[p2csym][m]];
|
|
1657
|
+
p2csym = SymMult[p2corn & 15][p2csym];
|
|
1658
|
+
p2corn >>= 4;
|
|
1659
|
+
p2edge = EPermMove[p2edge][SymMoveUD[p2esym][m]];
|
|
1660
|
+
p2esym = SymMult[p2edge & 15][p2esym];
|
|
1661
|
+
p2edge >>= 4;
|
|
1662
|
+
corni = getPermSymInv(p2corn, p2csym, true);
|
|
1663
|
+
edgei = getPermSymInv(p2edge, p2esym, false);
|
|
1664
|
+
} else if (this$static.preMoveLen > 0) {
|
|
1665
|
+
m = ($clinit_Util(), std2ud)[~~(lastPre / 3) * 3 + 1];
|
|
1666
|
+
this$static.preMoves[this$static.preMoveLen - 1] = ud2std[m] * 2 - this$static.preMoves[this$static.preMoveLen - 1];
|
|
1667
|
+
p2mid = ($clinit_CubieCube(), MPermInv)[($clinit_CoordCube(), MPermMove)[MPermInv[p2mid]][m]];
|
|
1668
|
+
p2corn = CPermMove[corni >> 4][SymMoveUD[corni & 15][m]];
|
|
1669
|
+
corni = p2corn & -16 | SymMult[p2corn & 15][corni & 15];
|
|
1670
|
+
p2corn = getPermSymInv(corni >> 4, corni & 15, true);
|
|
1671
|
+
p2csym = p2corn & 15;
|
|
1672
|
+
p2corn >>= 4;
|
|
1673
|
+
p2edge = EPermMove[edgei >> 4][SymMoveUD[edgei & 15][m]];
|
|
1674
|
+
edgei = p2edge & -16 | SymMult[p2edge & 15][edgei & 15];
|
|
1675
|
+
p2edge = getPermSymInv(edgei >> 4, edgei & 15, false);
|
|
1676
|
+
p2esym = p2edge & 15;
|
|
1677
|
+
p2edge >>= 4;
|
|
1678
|
+
}
|
|
1679
|
+
}
|
|
1680
|
+
this$static.depth1 > 0 && (this$static.move[this$static.depth1 - 1] = lastMove);
|
|
1681
|
+
this$static.preMoveLen > 0 && (this$static.preMoves[this$static.preMoveLen - 1] = lastPre);
|
|
1682
|
+
return ret === 0 ? 0 : 2;
|
|
1683
|
+
}
|
|
1684
|
+
function $initSearch(this$static) {
|
|
1685
|
+
var i;
|
|
1686
|
+
this$static.conjMask = 0;
|
|
1687
|
+
this$static.selfSym = $selfSymmetry(this$static.cc);
|
|
1688
|
+
this$static.conjMask |= neq(
|
|
1689
|
+
and(shr(this$static.selfSym, 16), {
|
|
1690
|
+
l: $intern_20,
|
|
1691
|
+
m: 0,
|
|
1692
|
+
h: 0
|
|
1693
|
+
}),
|
|
1694
|
+
{ l: 0, m: 0, h: 0 }
|
|
1695
|
+
) ? 18 : 0;
|
|
1696
|
+
this$static.conjMask |= neq(
|
|
1697
|
+
and(shr(this$static.selfSym, 32), {
|
|
1698
|
+
l: $intern_20,
|
|
1699
|
+
m: 0,
|
|
1700
|
+
h: 0
|
|
1701
|
+
}),
|
|
1702
|
+
{ l: 0, m: 0, h: 0 }
|
|
1703
|
+
) ? 36 : 0;
|
|
1704
|
+
this$static.conjMask |= neq(
|
|
1705
|
+
and(shr(this$static.selfSym, 48), {
|
|
1706
|
+
l: $intern_20,
|
|
1707
|
+
m: 0,
|
|
1708
|
+
h: 0
|
|
1709
|
+
}),
|
|
1710
|
+
{ l: 0, m: 0, h: 0 }
|
|
1711
|
+
) ? 56 : 0;
|
|
1712
|
+
this$static.selfSym = and(this$static.selfSym, {
|
|
1713
|
+
l: $intern_9,
|
|
1714
|
+
m: $intern_9,
|
|
1715
|
+
h: 15
|
|
1716
|
+
});
|
|
1717
|
+
this$static.maxPreMoves = this$static.conjMask > 7 ? 0 : 20;
|
|
1718
|
+
for (i = 0; i < 6; i++) {
|
|
1719
|
+
$copy(this$static.urfCubieCube[i], this$static.cc);
|
|
1720
|
+
$setWithPrun(this$static.urfCoordCube[i], this$static.urfCubieCube[i], 20);
|
|
1721
|
+
$URFConjugate(this$static.cc);
|
|
1722
|
+
i % 3 === 2 && $invCubieCube(this$static.cc);
|
|
1723
|
+
}
|
|
1724
|
+
}
|
|
1725
|
+
function $phase1(this$static, node, ssym, maxl, lm) {
|
|
1726
|
+
var axis_0;
|
|
1727
|
+
var m;
|
|
1728
|
+
var power;
|
|
1729
|
+
var prun;
|
|
1730
|
+
var ret;
|
|
1731
|
+
var skipMoves;
|
|
1732
|
+
if (node.prun === 0 && maxl < 5) {
|
|
1733
|
+
if (this$static.allowShorter || maxl === 0) {
|
|
1734
|
+
this$static.depth1 -= maxl;
|
|
1735
|
+
ret = $initPhase2Pre(this$static);
|
|
1736
|
+
this$static.depth1 += maxl;
|
|
1737
|
+
return ret;
|
|
1738
|
+
} else {
|
|
1739
|
+
return 1;
|
|
1740
|
+
}
|
|
1741
|
+
}
|
|
1742
|
+
skipMoves = getSkipMoves(fromInt(ssym));
|
|
1743
|
+
for (axis_0 = 0; axis_0 < 18; axis_0 += 3) {
|
|
1744
|
+
if (axis_0 === lm || axis_0 === lm - 9) {
|
|
1745
|
+
continue;
|
|
1746
|
+
}
|
|
1747
|
+
for (power = 0; power < 3; power++) {
|
|
1748
|
+
m = axis_0 + power;
|
|
1749
|
+
if (this$static.isRec && m !== this$static.move[this$static.depth1 - maxl] || skipMoves !== 0 && (skipMoves & 1 << m) !== 0) {
|
|
1750
|
+
continue;
|
|
1751
|
+
}
|
|
1752
|
+
prun = $doMovePrun(this$static.nodeUD[maxl], node, m);
|
|
1753
|
+
if (prun > maxl) {
|
|
1754
|
+
break;
|
|
1755
|
+
} else if (prun === maxl) {
|
|
1756
|
+
continue;
|
|
1757
|
+
}
|
|
1758
|
+
prun = $doMovePrunConj(this$static.nodeUD[maxl], node, m);
|
|
1759
|
+
if (prun > maxl) {
|
|
1760
|
+
break;
|
|
1761
|
+
} else if (prun === maxl) {
|
|
1762
|
+
continue;
|
|
1763
|
+
}
|
|
1764
|
+
this$static.move[this$static.depth1 - maxl] = m;
|
|
1765
|
+
this$static.valid1 = min_0(this$static.valid1, this$static.depth1 - maxl);
|
|
1766
|
+
ret = $phase1(
|
|
1767
|
+
this$static,
|
|
1768
|
+
this$static.nodeUD[maxl],
|
|
1769
|
+
ssym & toInt(($clinit_CubieCube(), moveCubeSym)[m]),
|
|
1770
|
+
maxl - 1,
|
|
1771
|
+
axis_0
|
|
1772
|
+
);
|
|
1773
|
+
if (ret === 0) {
|
|
1774
|
+
return 0;
|
|
1775
|
+
} else if (ret >= 2) {
|
|
1776
|
+
break;
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
}
|
|
1780
|
+
return 1;
|
|
1781
|
+
}
|
|
1782
|
+
function $phase1PreMoves(this$static, maxl, lm, cc, ssym) {
|
|
1783
|
+
var m;
|
|
1784
|
+
var ret;
|
|
1785
|
+
var skipMoves;
|
|
1786
|
+
this$static.preMoveLen = this$static.maxPreMoves - maxl;
|
|
1787
|
+
if (this$static.isRec ? this$static.depth1 === this$static.length1 - this$static.preMoveLen : this$static.preMoveLen === 0 || (225207 >> lm & 1) === 0) {
|
|
1788
|
+
this$static.depth1 = this$static.length1 - this$static.preMoveLen;
|
|
1789
|
+
this$static.phase1Cubie[0] = cc;
|
|
1790
|
+
this$static.allowShorter = this$static.depth1 === MIN_P1LENGTH_PRE && this$static.preMoveLen !== 0;
|
|
1791
|
+
if ($setWithPrun(
|
|
1792
|
+
this$static.nodeUD[this$static.depth1 + 1],
|
|
1793
|
+
cc,
|
|
1794
|
+
this$static.depth1
|
|
1795
|
+
) && $phase1(
|
|
1796
|
+
this$static,
|
|
1797
|
+
this$static.nodeUD[this$static.depth1 + 1],
|
|
1798
|
+
ssym,
|
|
1799
|
+
this$static.depth1,
|
|
1800
|
+
-1
|
|
1801
|
+
) === 0) {
|
|
1802
|
+
return 0;
|
|
1803
|
+
}
|
|
1804
|
+
}
|
|
1805
|
+
if (maxl === 0 || this$static.preMoveLen + MIN_P1LENGTH_PRE >= this$static.length1) {
|
|
1806
|
+
return 1;
|
|
1807
|
+
}
|
|
1808
|
+
skipMoves = getSkipMoves(fromInt(ssym));
|
|
1809
|
+
(maxl === 1 || this$static.preMoveLen + 1 + MIN_P1LENGTH_PRE >= this$static.length1) && (skipMoves |= 225207);
|
|
1810
|
+
lm = ~~(lm / 3) * 3;
|
|
1811
|
+
for (m = 0; m < 18; m++) {
|
|
1812
|
+
if (m === lm || m === lm - 9 || m === lm + 9) {
|
|
1813
|
+
m += 2;
|
|
1814
|
+
continue;
|
|
1815
|
+
}
|
|
1816
|
+
if (this$static.isRec && m !== this$static.preMoves[this$static.maxPreMoves - maxl] || (skipMoves & 1 << m) !== 0) {
|
|
1817
|
+
continue;
|
|
1818
|
+
}
|
|
1819
|
+
CornMult(
|
|
1820
|
+
($clinit_CubieCube(), moveCube)[m],
|
|
1821
|
+
cc,
|
|
1822
|
+
this$static.preMoveCubes[maxl]
|
|
1823
|
+
);
|
|
1824
|
+
EdgeMult(moveCube[m], cc, this$static.preMoveCubes[maxl]);
|
|
1825
|
+
this$static.preMoves[this$static.maxPreMoves - maxl] = m;
|
|
1826
|
+
ret = $phase1PreMoves(
|
|
1827
|
+
this$static,
|
|
1828
|
+
maxl - 1,
|
|
1829
|
+
m,
|
|
1830
|
+
this$static.preMoveCubes[maxl],
|
|
1831
|
+
ssym & toInt(moveCubeSym[m])
|
|
1832
|
+
);
|
|
1833
|
+
if (ret === 0) {
|
|
1834
|
+
return 0;
|
|
1835
|
+
}
|
|
1836
|
+
}
|
|
1837
|
+
return 1;
|
|
1838
|
+
}
|
|
1839
|
+
function $phase2(this$static, edge, esym, corn, csym, mid, maxl, depth, lm) {
|
|
1840
|
+
var corni;
|
|
1841
|
+
var cornx;
|
|
1842
|
+
var csymx;
|
|
1843
|
+
var edgei;
|
|
1844
|
+
var edgex;
|
|
1845
|
+
var esymx;
|
|
1846
|
+
var m;
|
|
1847
|
+
var midx;
|
|
1848
|
+
var moveMask;
|
|
1849
|
+
var prun;
|
|
1850
|
+
var ret;
|
|
1851
|
+
if (edge === 0 && corn === 0 && mid === 0) {
|
|
1852
|
+
return maxl;
|
|
1853
|
+
}
|
|
1854
|
+
moveMask = ($clinit_Util(), ckmv2bit)[lm];
|
|
1855
|
+
for (m = 0; m < 10; m++) {
|
|
1856
|
+
if ((moveMask >> m & 1) !== 0) {
|
|
1857
|
+
m += 66 >> m & 3;
|
|
1858
|
+
continue;
|
|
1859
|
+
}
|
|
1860
|
+
midx = ($clinit_CoordCube(), MPermMove)[mid][m];
|
|
1861
|
+
cornx = CPermMove[corn][($clinit_CubieCube(), SymMoveUD)[csym][m]];
|
|
1862
|
+
csymx = SymMult[cornx & 15][csym];
|
|
1863
|
+
cornx >>= 4;
|
|
1864
|
+
edgex = EPermMove[edge][SymMoveUD[esym][m]];
|
|
1865
|
+
esymx = SymMult[edgex & 15][esym];
|
|
1866
|
+
edgex >>= 4;
|
|
1867
|
+
edgei = getPermSymInv(edgex, esymx, false);
|
|
1868
|
+
corni = getPermSymInv(cornx, csymx, true);
|
|
1869
|
+
prun = getPruning(
|
|
1870
|
+
EPermCCombPPrun,
|
|
1871
|
+
(edgei >> 4) * 140 + CCombPConj[Perm2CombP[corni >> 4] & 255][SymMultInv[edgei & 15][corni & 15]]
|
|
1872
|
+
);
|
|
1873
|
+
if (prun > maxl + 1) {
|
|
1874
|
+
return maxl - prun + 1;
|
|
1875
|
+
} else if (prun >= maxl) {
|
|
1876
|
+
m += 66 >> m & 3 & maxl - prun;
|
|
1877
|
+
continue;
|
|
1878
|
+
}
|
|
1879
|
+
prun = max_0(
|
|
1880
|
+
getPruning(MCPermPrun, cornx * 24 + MPermConj[midx][csymx]),
|
|
1881
|
+
getPruning(
|
|
1882
|
+
EPermCCombPPrun,
|
|
1883
|
+
edgex * 140 + CCombPConj[Perm2CombP[cornx] & 255][SymMultInv[esymx][csymx]]
|
|
1884
|
+
)
|
|
1885
|
+
);
|
|
1886
|
+
if (prun >= maxl) {
|
|
1887
|
+
m += 66 >> m & 3 & maxl - prun;
|
|
1888
|
+
continue;
|
|
1889
|
+
}
|
|
1890
|
+
ret = $phase2(
|
|
1891
|
+
this$static,
|
|
1892
|
+
edgex,
|
|
1893
|
+
esymx,
|
|
1894
|
+
cornx,
|
|
1895
|
+
csymx,
|
|
1896
|
+
midx,
|
|
1897
|
+
maxl - 1,
|
|
1898
|
+
depth + 1,
|
|
1899
|
+
m
|
|
1900
|
+
);
|
|
1901
|
+
if (ret >= 0) {
|
|
1902
|
+
this$static.move[depth] = ud2std[m];
|
|
1903
|
+
return ret;
|
|
1904
|
+
}
|
|
1905
|
+
if (ret < -2) {
|
|
1906
|
+
break;
|
|
1907
|
+
}
|
|
1908
|
+
ret < -1 && (m += 66 >> m & 3);
|
|
1909
|
+
}
|
|
1910
|
+
return -1;
|
|
1911
|
+
}
|
|
1912
|
+
function $search(this$static) {
|
|
1913
|
+
for (this$static.length1 = this$static.isRec ? this$static.length1 : 0; this$static.length1 < this$static.solLen; this$static.length1++) {
|
|
1914
|
+
this$static.maxDep2 = min_0(
|
|
1915
|
+
MAX_DEPTH2,
|
|
1916
|
+
this$static.solLen - this$static.length1 - 1
|
|
1917
|
+
);
|
|
1918
|
+
for (this$static.urfIdx = this$static.isRec ? this$static.urfIdx : 0; this$static.urfIdx < 6; this$static.urfIdx++) {
|
|
1919
|
+
if ((this$static.conjMask & 1 << this$static.urfIdx) !== 0) {
|
|
1920
|
+
continue;
|
|
1921
|
+
}
|
|
1922
|
+
if ($phase1PreMoves(
|
|
1923
|
+
this$static,
|
|
1924
|
+
this$static.maxPreMoves,
|
|
1925
|
+
-30,
|
|
1926
|
+
this$static.urfCubieCube[this$static.urfIdx],
|
|
1927
|
+
toInt(and(this$static.selfSym, { l: $intern_20, m: 0, h: 0 }))
|
|
1928
|
+
) === 0) {
|
|
1929
|
+
return !this$static.solution ? "Error 8" : $toString_2(this$static.solution);
|
|
1930
|
+
}
|
|
1931
|
+
}
|
|
1932
|
+
}
|
|
1933
|
+
return !this$static.solution ? "Error 7" : $toString_2(this$static.solution);
|
|
1934
|
+
}
|
|
1935
|
+
function $solution(this$static, facelets) {
|
|
1936
|
+
var check;
|
|
1937
|
+
check = $verify_0(this$static, facelets);
|
|
1938
|
+
if (check !== 0) {
|
|
1939
|
+
return `Error ${check < 0 ? -check : check}`;
|
|
1940
|
+
}
|
|
1941
|
+
this$static.solLen = 22;
|
|
1942
|
+
this$static.probe = { l: 0, m: 0, h: 0 };
|
|
1943
|
+
this$static.probeMax = { l: 3531008, m: 23, h: 0 };
|
|
1944
|
+
this$static.probeMin = { l: 0, m: 0, h: 0 };
|
|
1945
|
+
this$static.verbose = 0;
|
|
1946
|
+
this$static.solution = null;
|
|
1947
|
+
this$static.isRec = false;
|
|
1948
|
+
init_0(false);
|
|
1949
|
+
$initSearch(this$static);
|
|
1950
|
+
return $search(this$static);
|
|
1951
|
+
}
|
|
1952
|
+
function $verify_0(this$static, facelets) {
|
|
1953
|
+
var center;
|
|
1954
|
+
var count;
|
|
1955
|
+
var f;
|
|
1956
|
+
var i;
|
|
1957
|
+
count = 0;
|
|
1958
|
+
f = initDim(B_classLit, $intern_30, 0, 54, 7, 1);
|
|
1959
|
+
center = _String(
|
|
1960
|
+
initValues(getClassLiteralForArray(C_classLit, 1), $intern_26, 0, 7, [
|
|
1961
|
+
facelets.charCodeAt(4),
|
|
1962
|
+
facelets.charCodeAt(13),
|
|
1963
|
+
facelets.charCodeAt(22),
|
|
1964
|
+
facelets.charCodeAt(31),
|
|
1965
|
+
facelets.charCodeAt(40),
|
|
1966
|
+
facelets.charCodeAt(49)
|
|
1967
|
+
])
|
|
1968
|
+
);
|
|
1969
|
+
for (i = 0; i < 54; i++) {
|
|
1970
|
+
f[i] = $indexOf_0(center, fromCodePoint(facelets.charCodeAt(i))) << 24 >> 24;
|
|
1971
|
+
if (f[i] === -1) {
|
|
1972
|
+
return -1;
|
|
1973
|
+
}
|
|
1974
|
+
count += 1 << (f[i] << 2);
|
|
1975
|
+
}
|
|
1976
|
+
if (count !== 10066329) {
|
|
1977
|
+
return -1;
|
|
1978
|
+
}
|
|
1979
|
+
toCubieCube(f, this$static.cc);
|
|
1980
|
+
return $verify(this$static.cc);
|
|
1981
|
+
}
|
|
1982
|
+
function Search() {
|
|
1983
|
+
var i;
|
|
1984
|
+
var i0;
|
|
1985
|
+
var i1;
|
|
1986
|
+
this.move = initDim(I_classLit, $intern_27, 0, 31, 7, 1);
|
|
1987
|
+
this.nodeUD = initDim(
|
|
1988
|
+
Lorg_cubing_min2phase_client_CoordCube_2_classLit,
|
|
1989
|
+
$intern_3,
|
|
1990
|
+
31,
|
|
1991
|
+
21,
|
|
1992
|
+
0,
|
|
1993
|
+
1
|
|
1994
|
+
);
|
|
1995
|
+
this.nodeRL = initDim(
|
|
1996
|
+
Lorg_cubing_min2phase_client_CoordCube_2_classLit,
|
|
1997
|
+
$intern_3,
|
|
1998
|
+
31,
|
|
1999
|
+
21,
|
|
2000
|
+
0,
|
|
2001
|
+
1
|
|
2002
|
+
);
|
|
2003
|
+
this.nodeFB = initDim(
|
|
2004
|
+
Lorg_cubing_min2phase_client_CoordCube_2_classLit,
|
|
2005
|
+
$intern_3,
|
|
2006
|
+
31,
|
|
2007
|
+
21,
|
|
2008
|
+
0,
|
|
2009
|
+
1
|
|
2010
|
+
);
|
|
2011
|
+
this.cc = new CubieCube();
|
|
2012
|
+
this.urfCubieCube = initDim(
|
|
2013
|
+
Lorg_cubing_min2phase_client_CubieCube_2_classLit,
|
|
2014
|
+
$intern_3,
|
|
2015
|
+
7,
|
|
2016
|
+
6,
|
|
2017
|
+
0,
|
|
2018
|
+
1
|
|
2019
|
+
);
|
|
2020
|
+
this.urfCoordCube = initDim(
|
|
2021
|
+
Lorg_cubing_min2phase_client_CoordCube_2_classLit,
|
|
2022
|
+
$intern_3,
|
|
2023
|
+
31,
|
|
2024
|
+
6,
|
|
2025
|
+
0,
|
|
2026
|
+
1
|
|
2027
|
+
);
|
|
2028
|
+
this.phase1Cubie = initDim(
|
|
2029
|
+
Lorg_cubing_min2phase_client_CubieCube_2_classLit,
|
|
2030
|
+
$intern_3,
|
|
2031
|
+
7,
|
|
2032
|
+
21,
|
|
2033
|
+
0,
|
|
2034
|
+
1
|
|
2035
|
+
);
|
|
2036
|
+
this.preMoveCubes = initDim(
|
|
2037
|
+
Lorg_cubing_min2phase_client_CubieCube_2_classLit,
|
|
2038
|
+
$intern_3,
|
|
2039
|
+
7,
|
|
2040
|
+
21,
|
|
2041
|
+
0,
|
|
2042
|
+
1
|
|
2043
|
+
);
|
|
2044
|
+
this.preMoves = initDim(I_classLit, $intern_27, 0, 20, 7, 1);
|
|
2045
|
+
for (i0 = 0; i0 < 21; i0++) {
|
|
2046
|
+
this.nodeUD[i0] = new CoordCube();
|
|
2047
|
+
this.nodeRL[i0] = new CoordCube();
|
|
2048
|
+
this.nodeFB[i0] = new CoordCube();
|
|
2049
|
+
this.phase1Cubie[i0] = new CubieCube();
|
|
2050
|
+
}
|
|
2051
|
+
for (i1 = 0; i1 < 6; i1++) {
|
|
2052
|
+
this.urfCubieCube[i1] = new CubieCube();
|
|
2053
|
+
this.urfCoordCube[i1] = new CoordCube();
|
|
2054
|
+
}
|
|
2055
|
+
for (i = 0; i < 20; i++) {
|
|
2056
|
+
this.preMoveCubes[i + 1] = new CubieCube();
|
|
2057
|
+
}
|
|
2058
|
+
}
|
|
2059
|
+
defineClass(72, 1, {}, Search);
|
|
2060
|
+
_.allowShorter = false;
|
|
2061
|
+
_.conjMask = 0;
|
|
2062
|
+
_.depth1 = 0;
|
|
2063
|
+
_.isRec = false;
|
|
2064
|
+
_.length1 = 0;
|
|
2065
|
+
_.maxDep2 = 0;
|
|
2066
|
+
_.maxPreMoves = 0;
|
|
2067
|
+
_.preMoveLen = 0;
|
|
2068
|
+
_.probe = { l: 0, m: 0, h: 0 };
|
|
2069
|
+
_.probeMax = { l: 0, m: 0, h: 0 };
|
|
2070
|
+
_.probeMin = { l: 0, m: 0, h: 0 };
|
|
2071
|
+
_.selfSym = { l: 0, m: 0, h: 0 };
|
|
2072
|
+
_.solLen = 0;
|
|
2073
|
+
_.urfIdx = 0;
|
|
2074
|
+
_.valid1 = 0;
|
|
2075
|
+
_.verbose = 0;
|
|
2076
|
+
var MAX_DEPTH2 = 12;
|
|
2077
|
+
var MIN_P1LENGTH_PRE = 7;
|
|
2078
|
+
var $clinit_Util_ran = false;
|
|
2079
|
+
function $clinit_Util() {
|
|
2080
|
+
if ($clinit_Util_ran) {
|
|
2081
|
+
return;
|
|
2082
|
+
}
|
|
2083
|
+
$clinit_Util_ran = true;
|
|
2084
|
+
var i;
|
|
2085
|
+
var i0;
|
|
2086
|
+
var i1;
|
|
2087
|
+
var ix;
|
|
2088
|
+
var j;
|
|
2089
|
+
var jx;
|
|
2090
|
+
cornerFacelet = initValues(
|
|
2091
|
+
getClassLiteralForArray(B_classLit, 2),
|
|
2092
|
+
$intern_3,
|
|
2093
|
+
10,
|
|
2094
|
+
0,
|
|
2095
|
+
[
|
|
2096
|
+
initValues(
|
|
2097
|
+
getClassLiteralForArray(B_classLit, 1),
|
|
2098
|
+
$intern_30,
|
|
2099
|
+
0,
|
|
2100
|
+
7,
|
|
2101
|
+
[8, 9, 20]
|
|
2102
|
+
),
|
|
2103
|
+
initValues(
|
|
2104
|
+
getClassLiteralForArray(B_classLit, 1),
|
|
2105
|
+
$intern_30,
|
|
2106
|
+
0,
|
|
2107
|
+
7,
|
|
2108
|
+
[6, 18, 38]
|
|
2109
|
+
),
|
|
2110
|
+
initValues(
|
|
2111
|
+
getClassLiteralForArray(B_classLit, 1),
|
|
2112
|
+
$intern_30,
|
|
2113
|
+
0,
|
|
2114
|
+
7,
|
|
2115
|
+
[0, 36, 47]
|
|
2116
|
+
),
|
|
2117
|
+
initValues(
|
|
2118
|
+
getClassLiteralForArray(B_classLit, 1),
|
|
2119
|
+
$intern_30,
|
|
2120
|
+
0,
|
|
2121
|
+
7,
|
|
2122
|
+
[2, 45, 11]
|
|
2123
|
+
),
|
|
2124
|
+
initValues(
|
|
2125
|
+
getClassLiteralForArray(B_classLit, 1),
|
|
2126
|
+
$intern_30,
|
|
2127
|
+
0,
|
|
2128
|
+
7,
|
|
2129
|
+
[29, 26, 15]
|
|
2130
|
+
),
|
|
2131
|
+
initValues(
|
|
2132
|
+
getClassLiteralForArray(B_classLit, 1),
|
|
2133
|
+
$intern_30,
|
|
2134
|
+
0,
|
|
2135
|
+
7,
|
|
2136
|
+
[27, 44, 24]
|
|
2137
|
+
),
|
|
2138
|
+
initValues(
|
|
2139
|
+
getClassLiteralForArray(B_classLit, 1),
|
|
2140
|
+
$intern_30,
|
|
2141
|
+
0,
|
|
2142
|
+
7,
|
|
2143
|
+
[33, 53, 42]
|
|
2144
|
+
),
|
|
2145
|
+
initValues(
|
|
2146
|
+
getClassLiteralForArray(B_classLit, 1),
|
|
2147
|
+
$intern_30,
|
|
2148
|
+
0,
|
|
2149
|
+
7,
|
|
2150
|
+
[35, 17, 51]
|
|
2151
|
+
)
|
|
2152
|
+
]
|
|
2153
|
+
);
|
|
2154
|
+
edgeFacelet = initValues(
|
|
2155
|
+
getClassLiteralForArray(B_classLit, 2),
|
|
2156
|
+
$intern_3,
|
|
2157
|
+
10,
|
|
2158
|
+
0,
|
|
2159
|
+
[
|
|
2160
|
+
initValues(
|
|
2161
|
+
getClassLiteralForArray(B_classLit, 1),
|
|
2162
|
+
$intern_30,
|
|
2163
|
+
0,
|
|
2164
|
+
7,
|
|
2165
|
+
[5, 10]
|
|
2166
|
+
),
|
|
2167
|
+
initValues(
|
|
2168
|
+
getClassLiteralForArray(B_classLit, 1),
|
|
2169
|
+
$intern_30,
|
|
2170
|
+
0,
|
|
2171
|
+
7,
|
|
2172
|
+
[7, 19]
|
|
2173
|
+
),
|
|
2174
|
+
initValues(
|
|
2175
|
+
getClassLiteralForArray(B_classLit, 1),
|
|
2176
|
+
$intern_30,
|
|
2177
|
+
0,
|
|
2178
|
+
7,
|
|
2179
|
+
[3, 37]
|
|
2180
|
+
),
|
|
2181
|
+
initValues(
|
|
2182
|
+
getClassLiteralForArray(B_classLit, 1),
|
|
2183
|
+
$intern_30,
|
|
2184
|
+
0,
|
|
2185
|
+
7,
|
|
2186
|
+
[1, 46]
|
|
2187
|
+
),
|
|
2188
|
+
initValues(
|
|
2189
|
+
getClassLiteralForArray(B_classLit, 1),
|
|
2190
|
+
$intern_30,
|
|
2191
|
+
0,
|
|
2192
|
+
7,
|
|
2193
|
+
[32, 16]
|
|
2194
|
+
),
|
|
2195
|
+
initValues(
|
|
2196
|
+
getClassLiteralForArray(B_classLit, 1),
|
|
2197
|
+
$intern_30,
|
|
2198
|
+
0,
|
|
2199
|
+
7,
|
|
2200
|
+
[28, 25]
|
|
2201
|
+
),
|
|
2202
|
+
initValues(
|
|
2203
|
+
getClassLiteralForArray(B_classLit, 1),
|
|
2204
|
+
$intern_30,
|
|
2205
|
+
0,
|
|
2206
|
+
7,
|
|
2207
|
+
[30, 43]
|
|
2208
|
+
),
|
|
2209
|
+
initValues(
|
|
2210
|
+
getClassLiteralForArray(B_classLit, 1),
|
|
2211
|
+
$intern_30,
|
|
2212
|
+
0,
|
|
2213
|
+
7,
|
|
2214
|
+
[34, 52]
|
|
2215
|
+
),
|
|
2216
|
+
initValues(
|
|
2217
|
+
getClassLiteralForArray(B_classLit, 1),
|
|
2218
|
+
$intern_30,
|
|
2219
|
+
0,
|
|
2220
|
+
7,
|
|
2221
|
+
[23, 12]
|
|
2222
|
+
),
|
|
2223
|
+
initValues(
|
|
2224
|
+
getClassLiteralForArray(B_classLit, 1),
|
|
2225
|
+
$intern_30,
|
|
2226
|
+
0,
|
|
2227
|
+
7,
|
|
2228
|
+
[21, 41]
|
|
2229
|
+
),
|
|
2230
|
+
initValues(
|
|
2231
|
+
getClassLiteralForArray(B_classLit, 1),
|
|
2232
|
+
$intern_30,
|
|
2233
|
+
0,
|
|
2234
|
+
7,
|
|
2235
|
+
[50, 39]
|
|
2236
|
+
),
|
|
2237
|
+
initValues(
|
|
2238
|
+
getClassLiteralForArray(B_classLit, 1),
|
|
2239
|
+
$intern_30,
|
|
2240
|
+
0,
|
|
2241
|
+
7,
|
|
2242
|
+
[48, 14]
|
|
2243
|
+
)
|
|
2244
|
+
]
|
|
2245
|
+
);
|
|
2246
|
+
Cnk = initDims(I_classLit, [$intern_3, $intern_27], [17, 0], 7, [13, 13], 2);
|
|
2247
|
+
move2str = initValues(
|
|
2248
|
+
getClassLiteralForArray(Ljava_lang_String_2_classLit, 1),
|
|
2249
|
+
$intern_3,
|
|
2250
|
+
2,
|
|
2251
|
+
4,
|
|
2252
|
+
[
|
|
2253
|
+
"U ",
|
|
2254
|
+
"U2",
|
|
2255
|
+
"U'",
|
|
2256
|
+
"R ",
|
|
2257
|
+
"R2",
|
|
2258
|
+
"R'",
|
|
2259
|
+
"F ",
|
|
2260
|
+
"F2",
|
|
2261
|
+
"F'",
|
|
2262
|
+
"D ",
|
|
2263
|
+
"D2",
|
|
2264
|
+
"D'",
|
|
2265
|
+
"L ",
|
|
2266
|
+
"L2",
|
|
2267
|
+
"L'",
|
|
2268
|
+
"B ",
|
|
2269
|
+
"B2",
|
|
2270
|
+
"B'"
|
|
2271
|
+
]
|
|
2272
|
+
);
|
|
2273
|
+
ud2std = initValues(
|
|
2274
|
+
getClassLiteralForArray(I_classLit, 1),
|
|
2275
|
+
$intern_27,
|
|
2276
|
+
0,
|
|
2277
|
+
7,
|
|
2278
|
+
[0, 1, 2, 4, 7, 9, 10, 11, 13, 16, 3, 5, 6, 8, 12, 14, 15, 17]
|
|
2279
|
+
);
|
|
2280
|
+
std2ud = initDim(I_classLit, $intern_27, 0, 18, 7, 1);
|
|
2281
|
+
ckmv2bit = initDim(I_classLit, $intern_27, 0, 11, 7, 1);
|
|
2282
|
+
for (i0 = 0; i0 < 18; i0++) {
|
|
2283
|
+
std2ud[ud2std[i0]] = i0;
|
|
2284
|
+
}
|
|
2285
|
+
for (i1 = 0; i1 < 10; i1++) {
|
|
2286
|
+
ix = ~~(ud2std[i1] / 3);
|
|
2287
|
+
ckmv2bit[i1] = 0;
|
|
2288
|
+
for (j = 0; j < 10; j++) {
|
|
2289
|
+
jx = ~~(ud2std[j] / 3);
|
|
2290
|
+
ckmv2bit[i1] |= (ix === jx || ix % 3 === jx % 3 && ix >= jx ? 1 : 0) << j;
|
|
2291
|
+
}
|
|
2292
|
+
}
|
|
2293
|
+
ckmv2bit[10] = 0;
|
|
2294
|
+
for (i = 0; i < 13; i++) {
|
|
2295
|
+
Cnk[i][0] = Cnk[i][i] = 1;
|
|
2296
|
+
for (j = 1; j < i; j++) {
|
|
2297
|
+
Cnk[i][j] = Cnk[i - 1][j - 1] + Cnk[i - 1][j];
|
|
2298
|
+
}
|
|
2299
|
+
}
|
|
2300
|
+
}
|
|
2301
|
+
function getComb(arr, mask, isEdge) {
|
|
2302
|
+
$clinit_Util();
|
|
2303
|
+
var end;
|
|
2304
|
+
var i;
|
|
2305
|
+
var idxC;
|
|
2306
|
+
var perm;
|
|
2307
|
+
var r;
|
|
2308
|
+
end = arr.length - 1;
|
|
2309
|
+
idxC = 0;
|
|
2310
|
+
r = 4;
|
|
2311
|
+
for (i = end; i >= 0; i--) {
|
|
2312
|
+
perm = getVal(arr[i], isEdge);
|
|
2313
|
+
(perm & 12) === mask && (idxC += Cnk[i][r--]);
|
|
2314
|
+
}
|
|
2315
|
+
return idxC;
|
|
2316
|
+
}
|
|
2317
|
+
function getNParity(idx, n) {
|
|
2318
|
+
$clinit_Util();
|
|
2319
|
+
var i;
|
|
2320
|
+
var p;
|
|
2321
|
+
p = 0;
|
|
2322
|
+
for (i = n - 2; i >= 0; i--) {
|
|
2323
|
+
p ^= idx % (n - i);
|
|
2324
|
+
idx = ~~(idx / (n - i));
|
|
2325
|
+
}
|
|
2326
|
+
return p & 1;
|
|
2327
|
+
}
|
|
2328
|
+
function getNPerm(arr, n, isEdge) {
|
|
2329
|
+
$clinit_Util();
|
|
2330
|
+
var i;
|
|
2331
|
+
var idx;
|
|
2332
|
+
var v;
|
|
2333
|
+
var val;
|
|
2334
|
+
idx = 0;
|
|
2335
|
+
val = { l: 1323536, m: 2777561, h: 1043915 };
|
|
2336
|
+
for (i = 0; i < n - 1; i++) {
|
|
2337
|
+
v = getVal(arr[i], isEdge) << 2;
|
|
2338
|
+
idx = (n - i) * idx + toInt(and(shr(val, v), { l: 15, m: 0, h: 0 }));
|
|
2339
|
+
val = sub_0(val, shl({ l: 1118480, m: 279620, h: 69905 }, v));
|
|
2340
|
+
}
|
|
2341
|
+
return idx;
|
|
2342
|
+
}
|
|
2343
|
+
function getVal(val0, isEdge) {
|
|
2344
|
+
return isEdge ? val0 >> 1 : val0 & 7;
|
|
2345
|
+
}
|
|
2346
|
+
function setComb(arr, idxC, mask, isEdge) {
|
|
2347
|
+
$clinit_Util();
|
|
2348
|
+
var end;
|
|
2349
|
+
var fill;
|
|
2350
|
+
var i;
|
|
2351
|
+
var r;
|
|
2352
|
+
end = arr.length - 1;
|
|
2353
|
+
r = 4;
|
|
2354
|
+
fill = end;
|
|
2355
|
+
for (i = end; i >= 0; i--) {
|
|
2356
|
+
if (idxC >= Cnk[i][r]) {
|
|
2357
|
+
idxC -= Cnk[i][r--];
|
|
2358
|
+
arr[i] = setVal(arr[i], r | mask, isEdge);
|
|
2359
|
+
} else {
|
|
2360
|
+
(fill & 12) === mask && (fill -= 4);
|
|
2361
|
+
arr[i] = setVal(arr[i], fill--, isEdge);
|
|
2362
|
+
}
|
|
2363
|
+
}
|
|
2364
|
+
}
|
|
2365
|
+
function setNPerm(arr, idx, n, isEdge) {
|
|
2366
|
+
$clinit_Util();
|
|
2367
|
+
var extract;
|
|
2368
|
+
var i;
|
|
2369
|
+
var m;
|
|
2370
|
+
var p;
|
|
2371
|
+
var v;
|
|
2372
|
+
var val;
|
|
2373
|
+
val = { l: 1323536, m: 2777561, h: 1043915 };
|
|
2374
|
+
extract = { l: 0, m: 0, h: 0 };
|
|
2375
|
+
for (p = 2; p <= n; p++) {
|
|
2376
|
+
extract = or(shl(extract, 4), fromInt(idx % p));
|
|
2377
|
+
idx = ~~(idx / p);
|
|
2378
|
+
}
|
|
2379
|
+
for (i = 0; i < n - 1; i++) {
|
|
2380
|
+
v = (toInt(extract) & 15) << 2;
|
|
2381
|
+
extract = shr(extract, 4);
|
|
2382
|
+
arr[i] = setVal(
|
|
2383
|
+
arr[i],
|
|
2384
|
+
toInt(and(shr(val, v), { l: 15, m: 0, h: 0 })),
|
|
2385
|
+
isEdge
|
|
2386
|
+
);
|
|
2387
|
+
m = sub_0(shl({ l: 1, m: 0, h: 0 }, v), { l: 1, m: 0, h: 0 });
|
|
2388
|
+
val = or(
|
|
2389
|
+
and(val, m),
|
|
2390
|
+
and(shr(val, 4), {
|
|
2391
|
+
l: ~m.l & $intern_9,
|
|
2392
|
+
m: ~m.m & $intern_9,
|
|
2393
|
+
h: ~m.h & $intern_10
|
|
2394
|
+
})
|
|
2395
|
+
);
|
|
2396
|
+
}
|
|
2397
|
+
arr[n - 1] = setVal(
|
|
2398
|
+
arr[n - 1],
|
|
2399
|
+
toInt(and(val, { l: 15, m: 0, h: 0 })),
|
|
2400
|
+
isEdge
|
|
2401
|
+
);
|
|
2402
|
+
}
|
|
2403
|
+
function setVal(val0, val, isEdge) {
|
|
2404
|
+
return (isEdge ? val << 1 | val0 & 1 : val | val0 & -8) << 24 >> 24;
|
|
2405
|
+
}
|
|
2406
|
+
function toCubieCube(f, ccRet) {
|
|
2407
|
+
$clinit_Util();
|
|
2408
|
+
var col1;
|
|
2409
|
+
var col2;
|
|
2410
|
+
var i;
|
|
2411
|
+
var i0;
|
|
2412
|
+
var i1;
|
|
2413
|
+
var i2;
|
|
2414
|
+
var j;
|
|
2415
|
+
var ori;
|
|
2416
|
+
for (i0 = 0; i0 < 8; i0++) {
|
|
2417
|
+
ccRet.ca[i0] = 0;
|
|
2418
|
+
}
|
|
2419
|
+
for (i1 = 0; i1 < 12; i1++) {
|
|
2420
|
+
ccRet.ea[i1] = 0;
|
|
2421
|
+
}
|
|
2422
|
+
for (i2 = 0; i2 < 8; i2++) {
|
|
2423
|
+
for (ori = 0; ori < 3; ori++) {
|
|
2424
|
+
if (f[cornerFacelet[i2][ori]] === 0 || f[cornerFacelet[i2][ori]] === 3) {
|
|
2425
|
+
break;
|
|
2426
|
+
}
|
|
2427
|
+
}
|
|
2428
|
+
col1 = f[cornerFacelet[i2][(ori + 1) % 3]];
|
|
2429
|
+
col2 = f[cornerFacelet[i2][(ori + 2) % 3]];
|
|
2430
|
+
for (j = 0; j < 8; j++) {
|
|
2431
|
+
if (col1 === ~~(cornerFacelet[j][1] / 9) && col2 === ~~(cornerFacelet[j][2] / 9)) {
|
|
2432
|
+
ccRet.ca[i2] = narrow_byte(ori % 3 << 3 | j);
|
|
2433
|
+
break;
|
|
2434
|
+
}
|
|
2435
|
+
}
|
|
2436
|
+
}
|
|
2437
|
+
for (i = 0; i < 12; i++) {
|
|
2438
|
+
for (j = 0; j < 12; j++) {
|
|
2439
|
+
if (f[edgeFacelet[i][0]] === ~~(edgeFacelet[j][0] / 9) && f[edgeFacelet[i][1]] === ~~(edgeFacelet[j][1] / 9)) {
|
|
2440
|
+
ccRet.ea[i] = narrow_byte(j << 1);
|
|
2441
|
+
break;
|
|
2442
|
+
}
|
|
2443
|
+
if (f[edgeFacelet[i][0]] === ~~(edgeFacelet[j][1] / 9) && f[edgeFacelet[i][1]] === ~~(edgeFacelet[j][0] / 9)) {
|
|
2444
|
+
ccRet.ea[i] = narrow_byte(j << 1 | 1);
|
|
2445
|
+
break;
|
|
2446
|
+
}
|
|
2447
|
+
}
|
|
2448
|
+
}
|
|
2449
|
+
}
|
|
2450
|
+
var Cnk;
|
|
2451
|
+
var ckmv2bit;
|
|
2452
|
+
var cornerFacelet;
|
|
2453
|
+
var edgeFacelet;
|
|
2454
|
+
var move2str;
|
|
2455
|
+
var std2ud;
|
|
2456
|
+
var ud2std;
|
|
2457
|
+
function $appendSolMove(this$static, curMove) {
|
|
2458
|
+
var axisCur;
|
|
2459
|
+
var axisLast;
|
|
2460
|
+
var pow_0;
|
|
2461
|
+
if (this$static.length_0 === 0) {
|
|
2462
|
+
this$static.moves[this$static.length_0++] = curMove;
|
|
2463
|
+
return;
|
|
2464
|
+
}
|
|
2465
|
+
axisCur = ~~(curMove / 3);
|
|
2466
|
+
axisLast = ~~(this$static.moves[this$static.length_0 - 1] / 3);
|
|
2467
|
+
if (axisCur === axisLast) {
|
|
2468
|
+
pow_0 = (curMove % 3 + this$static.moves[this$static.length_0 - 1] % 3 + 1) % 4;
|
|
2469
|
+
pow_0 === 3 ? --this$static.length_0 : this$static.moves[this$static.length_0 - 1] = axisCur * 3 + pow_0;
|
|
2470
|
+
return;
|
|
2471
|
+
}
|
|
2472
|
+
if (this$static.length_0 > 1 && axisCur % 3 === axisLast % 3 && axisCur === ~~(this$static.moves[this$static.length_0 - 2] / 3)) {
|
|
2473
|
+
pow_0 = (curMove % 3 + this$static.moves[this$static.length_0 - 2] % 3 + 1) % 4;
|
|
2474
|
+
if (pow_0 === 3) {
|
|
2475
|
+
this$static.moves[this$static.length_0 - 2] = this$static.moves[this$static.length_0 - 1];
|
|
2476
|
+
--this$static.length_0;
|
|
2477
|
+
} else {
|
|
2478
|
+
this$static.moves[this$static.length_0 - 2] = axisCur * 3 + pow_0;
|
|
2479
|
+
}
|
|
2480
|
+
return;
|
|
2481
|
+
}
|
|
2482
|
+
this$static.moves[this$static.length_0++] = curMove;
|
|
2483
|
+
}
|
|
2484
|
+
function $setArgs(this$static, verbose, urfIdx, depth1) {
|
|
2485
|
+
this$static.verbose = verbose;
|
|
2486
|
+
this$static.urfIdx = urfIdx;
|
|
2487
|
+
this$static.depth1 = depth1;
|
|
2488
|
+
}
|
|
2489
|
+
function $toString_2(this$static) {
|
|
2490
|
+
var s;
|
|
2491
|
+
var sb;
|
|
2492
|
+
var urf;
|
|
2493
|
+
sb = new StringBuffer();
|
|
2494
|
+
urf = (this$static.verbose & 2) !== 0 ? (this$static.urfIdx + 3) % 6 : this$static.urfIdx;
|
|
2495
|
+
if (urf < 3) {
|
|
2496
|
+
for (s = 0; s < this$static.length_0; s++) {
|
|
2497
|
+
(this$static.verbose & 1) !== 0 && s === this$static.depth1 && (sb.string += ". ", sb);
|
|
2498
|
+
$append(
|
|
2499
|
+
$append_1(
|
|
2500
|
+
sb,
|
|
2501
|
+
($clinit_Util(), move2str)[($clinit_CubieCube(), urfMove)[urf][this$static.moves[s]]]
|
|
2502
|
+
)
|
|
2503
|
+
);
|
|
2504
|
+
}
|
|
2505
|
+
} else {
|
|
2506
|
+
for (s = this$static.length_0 - 1; s >= 0; s--) {
|
|
2507
|
+
$append(
|
|
2508
|
+
$append_1(
|
|
2509
|
+
sb,
|
|
2510
|
+
($clinit_Util(), move2str)[($clinit_CubieCube(), urfMove)[urf][this$static.moves[s]]]
|
|
2511
|
+
)
|
|
2512
|
+
);
|
|
2513
|
+
(this$static.verbose & 1) !== 0 && s === this$static.depth1 && (sb.string += ". ", sb);
|
|
2514
|
+
}
|
|
2515
|
+
}
|
|
2516
|
+
return sb.string;
|
|
2517
|
+
}
|
|
2518
|
+
function Util$Solution() {
|
|
2519
|
+
this.moves = initDim(I_classLit, $intern_27, 0, 31, 7, 1);
|
|
2520
|
+
}
|
|
2521
|
+
defineClass(150, 1, {}, Util$Solution);
|
|
2522
|
+
_.depth1 = 0;
|
|
2523
|
+
_.length_0 = 0;
|
|
2524
|
+
_.urfIdx = 0;
|
|
2525
|
+
_.verbose = 0;
|
|
2526
|
+
var I_classLit = createForPrimitive("int", "I");
|
|
2527
|
+
createForClass("com.google.gwt.lang", "CollapsedPropertyHolder", 252);
|
|
2528
|
+
createForClass("com.google.gwt.lang", "JavaClassHierarchySetupUtil", 254);
|
|
2529
|
+
var Lcom_google_gwt_lang_LongLibBase$LongEmul_2_classLit = createForClass(
|
|
2530
|
+
"com.google.gwt.lang",
|
|
2531
|
+
"LongLibBase/LongEmul",
|
|
2532
|
+
null
|
|
2533
|
+
);
|
|
2534
|
+
createForClass("com.google.gwt.lang", "ModuleUtils", 257);
|
|
2535
|
+
var B_classLit = createForPrimitive("byte", "B");
|
|
2536
|
+
var J_classLit = createForPrimitive("long", "J");
|
|
2537
|
+
var C_classLit = createForPrimitive("char", "C");
|
|
2538
|
+
createForClass("com.google.gwt.user.client.rpc", "XsrfToken", null), createForInterface("java.util", "Map/Entry");
|
|
2539
|
+
var initialize = function() {
|
|
2540
|
+
init_0(false);
|
|
2541
|
+
};
|
|
2542
|
+
var solvePattern = function(s) {
|
|
2543
|
+
return $solution(new Search(), s);
|
|
2544
|
+
};
|
|
2545
|
+
export {
|
|
2546
|
+
initialize,
|
|
2547
|
+
solvePattern
|
|
2548
|
+
};
|
|
2549
|
+
//# sourceMappingURL=search-dynamic-solve-3x3x3-DLMAGPXS.js.map
|