cubing 0.66.0 → 0.66.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/chunks/{chunk-VTD7RU7S.js → chunk-HS7R54XN.js} +2 -2
- package/dist/bin/order.js +1 -1
- package/dist/bin/puzzle-geometry-bin.js +1 -1
- package/dist/bin/scramble.js +1 -1
- package/dist/bin/svg.js +1 -1
- package/dist/lib/cubing/alg/index.d.ts +1 -1
- package/dist/lib/cubing/alg/index.js +1 -2
- package/dist/lib/cubing/bluetooth/index.d.ts +2 -2
- package/dist/lib/cubing/bluetooth/index.js +5 -6
- package/dist/lib/cubing/chunks/{big-puzzle-orientation-KCHMEEM7.js → big-puzzle-orientation-KJL4OFV2.js} +1 -2
- package/dist/lib/cubing/chunks/{chunk-XAOXLHYH.js → chunk-6R47S6MP.js} +24 -25
- package/dist/lib/cubing/chunks/{chunk-ZCZVKGKB.js → chunk-7LEVC3YR.js} +1 -2
- package/dist/lib/cubing/chunks/{chunk-7GUL3OBQ.js → chunk-BHVTDDUY.js} +0 -1
- package/dist/lib/cubing/chunks/{chunk-JL5REGXZ.js → chunk-IIJFVP3K.js} +6 -7
- package/dist/lib/cubing/chunks/{chunk-6RZGNWLS.js → chunk-KH2MQ7KY.js} +2 -3
- package/dist/lib/cubing/chunks/{chunk-L6OQRJJX.js → chunk-LBER75W4.js} +1 -2
- package/dist/lib/cubing/chunks/{chunk-ZV7PYR2S.js → chunk-NJ66FRKF.js} +3 -4
- package/dist/lib/cubing/chunks/{chunk-CAQY24I5.js → chunk-QOLD6GH2.js} +5 -6
- package/dist/lib/cubing/chunks/{chunk-CFZLXDM6.js → chunk-QZK3M7IM.js} +0 -1
- package/dist/lib/cubing/chunks/chunk-RDKH6CDA.js +0 -0
- package/dist/lib/cubing/chunks/{chunk-4KLW7Y6J.js → chunk-T5M3DY5P.js} +2 -3
- package/dist/lib/cubing/chunks/{chunk-K237RIQJ.js → chunk-UKAXYOG2.js} +2 -3
- package/dist/lib/cubing/chunks/{chunk-GHFBZYSV.js → chunk-YJH5LHFN.js} +0 -1
- package/dist/lib/cubing/chunks/{inside-BAQGCKLY.js → inside-UWSZBO4Y.js} +14 -15
- package/dist/lib/cubing/chunks/{puzzles-dynamic-3x3x3-FYXD7SIU.js → puzzles-dynamic-3x3x3-CMH2HHH5.js} +0 -1
- package/dist/lib/cubing/chunks/{puzzles-dynamic-4x4x4-AIGABOAR.js → puzzles-dynamic-4x4x4-UFAQS3QG.js} +0 -1
- package/dist/lib/cubing/chunks/{puzzles-dynamic-megaminx-2LVHIDL4.js → puzzles-dynamic-megaminx-EFR4GQFA.js} +0 -1
- package/dist/lib/cubing/chunks/{puzzles-dynamic-side-events-653A7JCM.js → puzzles-dynamic-side-events-KF3PEOJN.js} +0 -1
- package/dist/lib/cubing/chunks/{puzzles-dynamic-unofficial-2CY6GVZ4.js → puzzles-dynamic-unofficial-6BF3EWTI.js} +0 -1
- package/dist/lib/cubing/chunks/{search-dynamic-sgs-side-events-KPAPKICT.js → search-dynamic-sgs-side-events-5GQDHSJR.js} +5 -6
- package/dist/lib/cubing/chunks/{search-dynamic-sgs-unofficial-WJZ2CWX5.js → search-dynamic-sgs-unofficial-YM23KVCN.js} +90 -78
- package/dist/lib/cubing/chunks/{search-dynamic-solve-3x3x3-B2L4IN34.js → search-dynamic-solve-3x3x3-6UMZH4WB.js} +3 -6
- package/dist/lib/cubing/chunks/{search-dynamic-solve-4x4x4-OLWUV6G6.js → search-dynamic-solve-4x4x4-KNSBAM7Q.js} +14 -17
- package/dist/lib/cubing/chunks/{search-dynamic-solve-fto-WLOW7LAM.js → search-dynamic-solve-fto-CSXJYISF.js} +200 -90
- package/dist/lib/cubing/chunks/{search-dynamic-solve-kilominx-KKUOVW5Y.js → search-dynamic-solve-kilominx-EHAUQJXS.js} +105 -113
- package/dist/lib/cubing/chunks/{search-dynamic-solve-master_tetraminx-GIS7T5B7.js → search-dynamic-solve-master_tetraminx-ZQ25QK7E.js} +99 -100
- package/dist/lib/cubing/chunks/search-worker-entry.js +2 -3
- package/dist/lib/cubing/chunks/{twips-J732JDZJ.js → twips-IMF5RNH5.js} +3 -4
- package/dist/lib/cubing/chunks/{twips_wasm_bg-TJNYGA2C-AP2O4LGG.js → twips_wasm_bg-TJNYGA2C-4JIZWC6Q.js} +1 -2
- package/dist/lib/cubing/chunks/{twisty-dynamic-3d-SFR3X64P.js → twisty-dynamic-3d-HSYJR5CM.js} +5 -6
- package/dist/lib/cubing/{index-Bfranlt_.d.ts → index-lAUL_nRN.d.ts} +1 -1
- package/dist/lib/cubing/{index-B2nOJwLe.d.ts → index-nWspzjVK.d.ts} +43 -39
- package/dist/lib/cubing/kpuzzle/index.d.ts +1 -1
- package/dist/lib/cubing/kpuzzle/index.js +2 -3
- package/dist/lib/cubing/notation/index.d.ts +1 -1
- package/dist/lib/cubing/notation/index.js +4 -5
- package/dist/lib/cubing/{outside-BdYfq43N.d.ts → outside-CD19aDjE.d.ts} +1 -1
- package/dist/lib/cubing/protocol/index.d.ts +1 -1
- package/dist/lib/cubing/protocol/index.js +4 -5
- package/dist/lib/cubing/puzzle-geometry/index.d.ts +1 -1
- package/dist/lib/cubing/puzzle-geometry/index.js +375 -375
- package/dist/lib/cubing/puzzles/index.d.ts +1 -1
- package/dist/lib/cubing/puzzles/index.js +4 -5
- package/dist/lib/cubing/scramble/index.d.ts +1 -1
- package/dist/lib/cubing/scramble/index.js +8 -9
- package/dist/lib/cubing/search/index.d.ts +1 -1
- package/dist/lib/cubing/search/index.js +7 -8
- package/dist/lib/cubing/stream/index.d.ts +1 -1
- package/dist/lib/cubing/stream/index.js +1 -2
- package/dist/lib/cubing/twisty/index.d.ts +1 -1
- package/dist/lib/cubing/twisty/index.js +6 -7
- package/package.json +1 -1
- package/dist/lib/cubing/alg/index.js.map +0 -7
- package/dist/lib/cubing/bluetooth/index.js.map +0 -7
- package/dist/lib/cubing/chunks/big-puzzle-orientation-KCHMEEM7.js.map +0 -7
- package/dist/lib/cubing/chunks/chunk-4KLW7Y6J.js.map +0 -7
- package/dist/lib/cubing/chunks/chunk-6RZGNWLS.js.map +0 -7
- package/dist/lib/cubing/chunks/chunk-7GUL3OBQ.js.map +0 -7
- package/dist/lib/cubing/chunks/chunk-CAQY24I5.js.map +0 -7
- package/dist/lib/cubing/chunks/chunk-CFZLXDM6.js.map +0 -7
- package/dist/lib/cubing/chunks/chunk-GHFBZYSV.js.map +0 -7
- package/dist/lib/cubing/chunks/chunk-JL5REGXZ.js.map +0 -7
- package/dist/lib/cubing/chunks/chunk-K237RIQJ.js.map +0 -7
- package/dist/lib/cubing/chunks/chunk-L6OQRJJX.js.map +0 -7
- package/dist/lib/cubing/chunks/chunk-NAPITA3L.js +0 -1
- package/dist/lib/cubing/chunks/chunk-NAPITA3L.js.map +0 -7
- package/dist/lib/cubing/chunks/chunk-XAOXLHYH.js.map +0 -7
- package/dist/lib/cubing/chunks/chunk-ZCZVKGKB.js.map +0 -7
- package/dist/lib/cubing/chunks/chunk-ZV7PYR2S.js.map +0 -7
- package/dist/lib/cubing/chunks/inside-BAQGCKLY.js.map +0 -7
- package/dist/lib/cubing/chunks/puzzles-dynamic-3x3x3-FYXD7SIU.js.map +0 -7
- package/dist/lib/cubing/chunks/puzzles-dynamic-4x4x4-AIGABOAR.js.map +0 -7
- package/dist/lib/cubing/chunks/puzzles-dynamic-megaminx-2LVHIDL4.js.map +0 -7
- package/dist/lib/cubing/chunks/puzzles-dynamic-side-events-653A7JCM.js.map +0 -7
- package/dist/lib/cubing/chunks/puzzles-dynamic-unofficial-2CY6GVZ4.js.map +0 -7
- package/dist/lib/cubing/chunks/search-dynamic-sgs-side-events-KPAPKICT.js.map +0 -7
- package/dist/lib/cubing/chunks/search-dynamic-sgs-unofficial-WJZ2CWX5.js.map +0 -7
- package/dist/lib/cubing/chunks/search-dynamic-solve-3x3x3-B2L4IN34.js.map +0 -7
- package/dist/lib/cubing/chunks/search-dynamic-solve-4x4x4-OLWUV6G6.js.map +0 -7
- package/dist/lib/cubing/chunks/search-dynamic-solve-fto-WLOW7LAM.js.map +0 -7
- package/dist/lib/cubing/chunks/search-dynamic-solve-kilominx-KKUOVW5Y.js.map +0 -7
- package/dist/lib/cubing/chunks/search-dynamic-solve-master_tetraminx-GIS7T5B7.js.map +0 -7
- package/dist/lib/cubing/chunks/search-worker-entry.js.map +0 -7
- package/dist/lib/cubing/chunks/twips-J732JDZJ.js.map +0 -7
- package/dist/lib/cubing/chunks/twips_wasm_bg-TJNYGA2C-AP2O4LGG.js.map +0 -7
- package/dist/lib/cubing/chunks/twisty-dynamic-3d-SFR3X64P.js.map +0 -7
- package/dist/lib/cubing/kpuzzle/index.js.map +0 -7
- package/dist/lib/cubing/notation/index.js.map +0 -7
- package/dist/lib/cubing/protocol/index.js.map +0 -7
- package/dist/lib/cubing/puzzle-geometry/index.js.map +0 -7
- package/dist/lib/cubing/puzzles/index.js.map +0 -7
- package/dist/lib/cubing/scramble/index.js.map +0 -7
- package/dist/lib/cubing/search/index.js.map +0 -7
- package/dist/lib/cubing/stream/index.js.map +0 -7
- package/dist/lib/cubing/twisty/index.js.map +0 -7
- /package/dist/bin/chunks/{chunk-VTD7RU7S.js.map → chunk-HS7R54XN.js.map} +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseSGS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7LEVC3YR.js";
|
|
4
4
|
import {
|
|
5
5
|
cube2x2x2,
|
|
6
6
|
puzzles
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-6R47S6MP.js";
|
|
8
|
+
import "./chunk-IIJFVP3K.js";
|
|
9
9
|
import {
|
|
10
10
|
KPuzzle
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-LBER75W4.js";
|
|
12
|
+
import "./chunk-QZK3M7IM.js";
|
|
13
13
|
|
|
14
14
|
// src/cubing/search/inside/solve/puzzles/dynamic/sgs-side-events/2x2x2.sgs.ts
|
|
15
15
|
var cachedData = null;
|
|
@@ -1888,4 +1888,3 @@ export {
|
|
|
1888
1888
|
sgsDataSkewbFixedCorner,
|
|
1889
1889
|
skewbKPuzzleWithoutMOCached
|
|
1890
1890
|
};
|
|
1891
|
-
//# sourceMappingURL=search-dynamic-sgs-side-events-KPAPKICT.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseSGS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7LEVC3YR.js";
|
|
4
4
|
import {
|
|
5
5
|
puzzles
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-6R47S6MP.js";
|
|
7
|
+
import "./chunk-IIJFVP3K.js";
|
|
8
|
+
import "./chunk-LBER75W4.js";
|
|
9
9
|
import {
|
|
10
10
|
Alg
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-QZK3M7IM.js";
|
|
12
12
|
|
|
13
|
-
// src/cubing/vendor/mpl/xyzzy/redi_cube.
|
|
13
|
+
// src/cubing/vendor/mpl/xyzzy/redi_cube.ts
|
|
14
14
|
import { randomUIntBelow } from "random-uint-below";
|
|
15
15
|
function factorial(n) {
|
|
16
16
|
if (n < 2) {
|
|
@@ -42,10 +42,10 @@ function permutation_to_index(perm) {
|
|
|
42
42
|
let ind = 0;
|
|
43
43
|
while (n > 1) {
|
|
44
44
|
n--;
|
|
45
|
-
|
|
45
|
+
const e = perm[0];
|
|
46
46
|
ind += e * f;
|
|
47
47
|
for (let i = 0; i < n; i++) {
|
|
48
|
-
|
|
48
|
+
const x = perm[i + 1];
|
|
49
49
|
perm[i] = x - (x > e);
|
|
50
50
|
}
|
|
51
51
|
f /= n;
|
|
@@ -53,7 +53,7 @@ function permutation_to_index(perm) {
|
|
|
53
53
|
return ind;
|
|
54
54
|
}
|
|
55
55
|
function index_to_permutation(ind, n) {
|
|
56
|
-
|
|
56
|
+
const perm = [];
|
|
57
57
|
let f = factorial(n - 1);
|
|
58
58
|
for (let i = 0; i < n; i++) {
|
|
59
59
|
perm[i] = ind / f | 0;
|
|
@@ -68,7 +68,7 @@ function index_to_permutation(ind, n) {
|
|
|
68
68
|
return perm;
|
|
69
69
|
}
|
|
70
70
|
function permutation_parity(A) {
|
|
71
|
-
|
|
71
|
+
const n = A.length;
|
|
72
72
|
let parity = 0;
|
|
73
73
|
for (let i = 0; i < n - 1; i++) {
|
|
74
74
|
for (let j = i; j < n; j++) {
|
|
@@ -80,7 +80,7 @@ function permutation_parity(A) {
|
|
|
80
80
|
return parity;
|
|
81
81
|
}
|
|
82
82
|
function index_to_evenpermutation(ind, n) {
|
|
83
|
-
|
|
83
|
+
const perm = [];
|
|
84
84
|
let f = factorial(n - 1) / 2;
|
|
85
85
|
let parity = 0;
|
|
86
86
|
for (let i = 0; i < n - 1; i++) {
|
|
@@ -132,8 +132,8 @@ function comb_to_index(l) {
|
|
|
132
132
|
function index_to_comb(ind, ones, bits) {
|
|
133
133
|
let zeros = bits - ones;
|
|
134
134
|
let b = C(bits - 1, ones);
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
const l = [];
|
|
136
|
+
const n = bits - 1;
|
|
137
137
|
for (let i = 0; i < n; i++) {
|
|
138
138
|
bits--;
|
|
139
139
|
if (ind < b) {
|
|
@@ -149,14 +149,14 @@ function index_to_comb(ind, ones, bits) {
|
|
|
149
149
|
return l;
|
|
150
150
|
}
|
|
151
151
|
function compose(A, B) {
|
|
152
|
-
|
|
152
|
+
const C2 = [];
|
|
153
153
|
for (let i = 0; i < B.length; i++) {
|
|
154
154
|
C2[i] = A[B[i]];
|
|
155
155
|
}
|
|
156
156
|
return C2;
|
|
157
157
|
}
|
|
158
158
|
function permutation_from_cycle(cycle, n) {
|
|
159
|
-
|
|
159
|
+
const perm = [];
|
|
160
160
|
for (let i = 0; i < n; i++) {
|
|
161
161
|
perm[i] = i;
|
|
162
162
|
}
|
|
@@ -166,14 +166,14 @@ function permutation_from_cycle(cycle, n) {
|
|
|
166
166
|
return perm;
|
|
167
167
|
}
|
|
168
168
|
function unsparsify_list(d, n) {
|
|
169
|
-
|
|
170
|
-
for (
|
|
169
|
+
const l = Array(n).fill(0);
|
|
170
|
+
for (const k in d) {
|
|
171
171
|
l[k] = d[k];
|
|
172
172
|
}
|
|
173
173
|
return l;
|
|
174
174
|
}
|
|
175
175
|
function compose_state(state1, state2) {
|
|
176
|
-
|
|
176
|
+
const o = Array(8).fill(0);
|
|
177
177
|
for (let i = 0; i < 8; i++) {
|
|
178
178
|
o[i] = (state1[1][i] + state2[1][i]) % 3;
|
|
179
179
|
}
|
|
@@ -212,20 +212,29 @@ var move_D = [
|
|
|
212
212
|
unsparsify_list({ 7: 2 }, 8)
|
|
213
213
|
];
|
|
214
214
|
var solved = [index_to_permutation(0, 12), Array(8).fill(0)];
|
|
215
|
-
var moves = [
|
|
215
|
+
var moves = [
|
|
216
|
+
move_UL,
|
|
217
|
+
move_U,
|
|
218
|
+
move_UR,
|
|
219
|
+
move_F,
|
|
220
|
+
move_L,
|
|
221
|
+
move_B,
|
|
222
|
+
move_R,
|
|
223
|
+
move_D
|
|
224
|
+
];
|
|
216
225
|
var move_names = ["UL", "U", "UR", "F", "L", "B", "R", "D"];
|
|
217
226
|
var tetrad = [0, 1, 0, 1, 1, 0, 1, 0];
|
|
218
227
|
function stringify_move_sequence(move_sequence) {
|
|
219
|
-
|
|
220
|
-
|
|
228
|
+
const suffixes = ["0", "", "'"];
|
|
229
|
+
const s = move_sequence.map(([m, r]) => move_names[m] + suffixes[r]);
|
|
221
230
|
return s.join(" ");
|
|
222
231
|
}
|
|
223
232
|
function generate_random_state() {
|
|
224
|
-
|
|
233
|
+
const p = index_to_evenpermutation(
|
|
225
234
|
Math.floor(randomUIntBelow(factorial(12)) / 2),
|
|
226
235
|
12
|
|
227
236
|
);
|
|
228
|
-
|
|
237
|
+
const o = Array(8);
|
|
229
238
|
for (let i = 0; i < 8; i++) {
|
|
230
239
|
o[i] = randomUIntBelow(3);
|
|
231
240
|
}
|
|
@@ -235,31 +244,35 @@ function generate_random_state_scramble() {
|
|
|
235
244
|
return solve(generate_random_state());
|
|
236
245
|
}
|
|
237
246
|
function solve(state) {
|
|
238
|
-
|
|
239
|
-
|
|
247
|
+
const phase1_indices = index_phase1(state);
|
|
248
|
+
const phase1_mtables = [
|
|
240
249
|
generate_phase1_edge_mtable(),
|
|
241
250
|
generate_phase1_separate_mtable()
|
|
242
251
|
];
|
|
243
|
-
|
|
252
|
+
const phase1_ptables = [
|
|
244
253
|
generate_phase1_edge_ptable(),
|
|
245
254
|
generate_phase1_separate_ptable()
|
|
246
255
|
];
|
|
247
|
-
|
|
256
|
+
const phase2_mtables = [
|
|
248
257
|
generate_phase2_edge_mtable(),
|
|
249
258
|
generate_phase2_corner_mtable()
|
|
250
259
|
];
|
|
251
|
-
|
|
260
|
+
const phase2_ptables = [
|
|
252
261
|
generate_phase2_edge_ptable(),
|
|
253
262
|
generate_phase1_corner_ptable()
|
|
254
263
|
];
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
264
|
+
const phase1gen = ida_solve_gen(
|
|
265
|
+
phase1_indices,
|
|
266
|
+
phase1_mtables,
|
|
267
|
+
phase1_ptables
|
|
268
|
+
);
|
|
269
|
+
let best;
|
|
270
|
+
const intermediate_states = /* @__PURE__ */ new Set();
|
|
271
|
+
const start_time = +/* @__PURE__ */ new Date();
|
|
259
272
|
for (let i = 0; i < 25; i++) {
|
|
260
|
-
|
|
273
|
+
const { value: sol1, done } = phase1gen.next();
|
|
261
274
|
let new_state = state;
|
|
262
|
-
for (
|
|
275
|
+
for (const [m, r] of sol1) {
|
|
263
276
|
for (let i2 = 0; i2 < r; i2++) {
|
|
264
277
|
new_state = compose_state(new_state, moves[m]);
|
|
265
278
|
}
|
|
@@ -269,14 +282,14 @@ function solve(state) {
|
|
|
269
282
|
} else {
|
|
270
283
|
intermediate_states.add(new_state.toString());
|
|
271
284
|
}
|
|
272
|
-
|
|
285
|
+
const edge_ind = evenpermutation_to_index(new_state[0].slice(0, 8));
|
|
273
286
|
let corner_ind = 0;
|
|
274
287
|
for (let i2 = 0; i2 < 4; i2++) {
|
|
275
288
|
corner_ind += new_state[1][i2] * 3 ** i2;
|
|
276
289
|
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
290
|
+
const phase2_indices = [edge_ind, corner_ind];
|
|
291
|
+
const moves_left = best ? best.length - sol1.length - 1 : 999999;
|
|
292
|
+
const sol2 = ida_solve(
|
|
280
293
|
phase2_indices,
|
|
281
294
|
phase2_mtables,
|
|
282
295
|
phase2_ptables,
|
|
@@ -303,8 +316,8 @@ function index_phase1(state) {
|
|
|
303
316
|
for (let i = 0; i < 4; i++) {
|
|
304
317
|
corner_ind += state[1][i + 4] * 3 ** i;
|
|
305
318
|
}
|
|
306
|
-
|
|
307
|
-
|
|
319
|
+
const filtered = state[0].map((x) => Math.max(-1, x - 8));
|
|
320
|
+
const separate_ind = comb_to_index(filtered.map((x) => +(x >= 0))) * 2 + permutation_parity(filtered.filter((x) => x >= 0));
|
|
308
321
|
return [edge_ind, corner_ind + 81 * separate_ind];
|
|
309
322
|
}
|
|
310
323
|
var tables = {};
|
|
@@ -312,10 +325,10 @@ function generate_phase1_corner_mtable() {
|
|
|
312
325
|
if (tables.phase1cm) {
|
|
313
326
|
return tables.phase1cm;
|
|
314
327
|
}
|
|
315
|
-
|
|
328
|
+
const mtable = [];
|
|
316
329
|
for (let i = 0; i < 81; i++) {
|
|
317
330
|
mtable[i] = Array(8);
|
|
318
|
-
|
|
331
|
+
const o = [
|
|
319
332
|
i % 3,
|
|
320
333
|
Math.floor(i / 3) % 3,
|
|
321
334
|
Math.floor(i / 9) % 3,
|
|
@@ -334,9 +347,9 @@ function generate_phase1_corner_ptable() {
|
|
|
334
347
|
if (tables.phase1cp) {
|
|
335
348
|
return tables.phase1cp;
|
|
336
349
|
}
|
|
337
|
-
|
|
350
|
+
const ptable = Array(81);
|
|
338
351
|
for (let i = 0; i < 81; i++) {
|
|
339
|
-
|
|
352
|
+
const o = [
|
|
340
353
|
i % 3,
|
|
341
354
|
Math.floor(i / 3) % 3,
|
|
342
355
|
Math.floor(i / 9) % 3,
|
|
@@ -350,14 +363,14 @@ function generate_phase1_edge_mtable() {
|
|
|
350
363
|
if (tables.phase1em) {
|
|
351
364
|
return tables.phase1em;
|
|
352
365
|
}
|
|
353
|
-
|
|
366
|
+
const mtable_single = [];
|
|
354
367
|
for (let i = 0; i < 12; i++) {
|
|
355
368
|
mtable_single[i] = [];
|
|
356
369
|
for (let m = 0; m < 8; m++) {
|
|
357
370
|
mtable_single[i][m] = moves[m][0].indexOf(i);
|
|
358
371
|
}
|
|
359
372
|
}
|
|
360
|
-
|
|
373
|
+
const mtable = Array(12 ** 4);
|
|
361
374
|
for (let i = 0; i < 12 ** 4; i++) {
|
|
362
375
|
mtable[i] = Array(8);
|
|
363
376
|
for (let m = 0; m < 8; m++) {
|
|
@@ -383,11 +396,11 @@ function generate_phase1_separate_mtable() {
|
|
|
383
396
|
return tables.phase1sm;
|
|
384
397
|
}
|
|
385
398
|
const C12_4 = C(12, 4);
|
|
386
|
-
|
|
399
|
+
const mtable_c = [];
|
|
387
400
|
for (let i = 0; i < C12_4; i++) {
|
|
388
401
|
mtable_c[i] = [];
|
|
389
|
-
|
|
390
|
-
|
|
402
|
+
const comb = index_to_comb(i, 4, 12);
|
|
403
|
+
const perm = [];
|
|
391
404
|
for (let j = 0, k = 0; j < 12; j++) {
|
|
392
405
|
if (comb[j] === 0) {
|
|
393
406
|
perm[j] = -1;
|
|
@@ -396,18 +409,18 @@ function generate_phase1_separate_mtable() {
|
|
|
396
409
|
}
|
|
397
410
|
}
|
|
398
411
|
for (let m = 0; m < 8; m++) {
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
412
|
+
const new_perm = compose(perm, moves[m][0]);
|
|
413
|
+
const new_comb = compose(comb, moves[m][0]);
|
|
414
|
+
const parity = permutation_parity(new_perm.filter((x) => x >= 0));
|
|
402
415
|
mtable_c[i][m] = comb_to_index(new_comb) * 2 + parity;
|
|
403
416
|
}
|
|
404
417
|
}
|
|
405
|
-
|
|
406
|
-
|
|
418
|
+
const mtable_co = generate_phase1_corner_mtable();
|
|
419
|
+
const mtable = [];
|
|
407
420
|
for (let j = 0; j < C12_4; j++) {
|
|
408
421
|
for (let i = 0; i < 81; i++) {
|
|
409
|
-
|
|
410
|
-
|
|
422
|
+
const m0 = mtable[i + 81 * (2 * j)] = [];
|
|
423
|
+
const m1 = mtable[i + 81 * (2 * j + 1)] = [];
|
|
411
424
|
for (let m = 0; m < 8; m++) {
|
|
412
425
|
m0[m] = mtable_co[i][m] + 81 * mtable_c[j][m];
|
|
413
426
|
m1[m] = mtable_co[i][m] + 81 * (mtable_c[j][m] ^ 1);
|
|
@@ -426,8 +439,8 @@ function generate_phase2_corner_mtable() {
|
|
|
426
439
|
if (tables.phase2cm) {
|
|
427
440
|
return tables.phase2cm;
|
|
428
441
|
}
|
|
429
|
-
|
|
430
|
-
|
|
442
|
+
const phase1_mtable = generate_phase1_corner_mtable();
|
|
443
|
+
const mtable = Array(81);
|
|
431
444
|
for (let i = 0; i < 81; i++) {
|
|
432
445
|
mtable[i] = phase1_mtable[i].slice(4, 8);
|
|
433
446
|
}
|
|
@@ -439,12 +452,12 @@ function generate_phase2_edge_mtable() {
|
|
|
439
452
|
}
|
|
440
453
|
const n = 8;
|
|
441
454
|
const HALFFACT8 = factorial(n) / 2;
|
|
442
|
-
|
|
443
|
-
|
|
455
|
+
const mtable = Array(HALFFACT8);
|
|
456
|
+
const perm = [0, 1, 2, 3, 4, 5, 6, 7];
|
|
444
457
|
for (let i = 0; i < HALFFACT8; i++) {
|
|
445
458
|
mtable[i] = Array(4);
|
|
446
459
|
for (let m = 0; m < 4; m++) {
|
|
447
|
-
|
|
460
|
+
const new_perm = compose(perm, moves[m][0].slice(0, 8));
|
|
448
461
|
mtable[i][m] = evenpermutation_to_index(new_perm);
|
|
449
462
|
}
|
|
450
463
|
if (i === HALFFACT8 - 1) {
|
|
@@ -483,15 +496,15 @@ function generate_phase2_edge_ptable() {
|
|
|
483
496
|
return tables.phase2ep = bfs(generate_phase2_edge_mtable(), [0]);
|
|
484
497
|
}
|
|
485
498
|
function bfs(mtable, goal_states) {
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
499
|
+
const N = mtable.length;
|
|
500
|
+
const nmoves = mtable[0].length;
|
|
501
|
+
const ptable = Array(N).fill(-1);
|
|
489
502
|
let queue = goal_states.slice();
|
|
490
503
|
let new_queue = [];
|
|
491
504
|
let depth = 0;
|
|
492
505
|
while (queue.length > 0) {
|
|
493
506
|
new_queue.length = 0;
|
|
494
|
-
for (
|
|
507
|
+
for (const state of queue) {
|
|
495
508
|
if (ptable[state] !== -1) {
|
|
496
509
|
continue;
|
|
497
510
|
}
|
|
@@ -511,13 +524,13 @@ function bfs(mtable, goal_states) {
|
|
|
511
524
|
}
|
|
512
525
|
function ida_solve(indices, mtables, ptables, max_bound) {
|
|
513
526
|
max_bound = max_bound || 999999;
|
|
514
|
-
|
|
527
|
+
const ncoords = indices.length;
|
|
515
528
|
let bound = 0;
|
|
516
529
|
for (let i = 0; i < ncoords; i++) {
|
|
517
530
|
bound = Math.max(bound, ptables[i][indices[i]]);
|
|
518
531
|
}
|
|
519
532
|
while (bound <= max_bound) {
|
|
520
|
-
|
|
533
|
+
const path = ida_search(indices, mtables, ptables, bound, -1);
|
|
521
534
|
if (path !== void 0) {
|
|
522
535
|
return path;
|
|
523
536
|
}
|
|
@@ -525,8 +538,8 @@ function ida_solve(indices, mtables, ptables, max_bound) {
|
|
|
525
538
|
}
|
|
526
539
|
}
|
|
527
540
|
function ida_search(indices, mtables, ptables, bound, last) {
|
|
528
|
-
|
|
529
|
-
|
|
541
|
+
const ncoords = indices.length;
|
|
542
|
+
const nmoves = mtables[0][0].length;
|
|
530
543
|
let heuristic = 0;
|
|
531
544
|
for (let i = 0; i < ncoords; i++) {
|
|
532
545
|
heuristic = Math.max(heuristic, ptables[i][indices[i]]);
|
|
@@ -547,13 +560,13 @@ function ida_search(indices, mtables, ptables, bound, last) {
|
|
|
547
560
|
if (m < last && tetrad[m] === tetrad[last]) {
|
|
548
561
|
continue;
|
|
549
562
|
}
|
|
550
|
-
|
|
563
|
+
const new_indices = indices.slice();
|
|
551
564
|
for (let c = 0; c < ncoords; c++) {
|
|
552
565
|
new_indices[c] = mtables[c][indices[c]][m];
|
|
553
566
|
}
|
|
554
567
|
let r = 1;
|
|
555
568
|
while (indices.some((_, i) => indices[i] !== new_indices[i])) {
|
|
556
|
-
|
|
569
|
+
const subpath = ida_search(new_indices, mtables, ptables, bound - 1, m);
|
|
557
570
|
if (subpath !== void 0) {
|
|
558
571
|
return [[m, r]].concat(subpath);
|
|
559
572
|
}
|
|
@@ -566,7 +579,7 @@ function ida_search(indices, mtables, ptables, bound, last) {
|
|
|
566
579
|
return;
|
|
567
580
|
}
|
|
568
581
|
function* ida_solve_gen(indices, mtables, ptables) {
|
|
569
|
-
|
|
582
|
+
const ncoords = indices.length;
|
|
570
583
|
let bound = 0;
|
|
571
584
|
for (let i = 0; i < ncoords; i++) {
|
|
572
585
|
bound = Math.max(bound, ptables[i][indices[i]]);
|
|
@@ -577,8 +590,8 @@ function* ida_solve_gen(indices, mtables, ptables) {
|
|
|
577
590
|
}
|
|
578
591
|
}
|
|
579
592
|
function* ida_search_gen(indices, mtables, ptables, bound, last) {
|
|
580
|
-
|
|
581
|
-
|
|
593
|
+
const ncoords = indices.length;
|
|
594
|
+
const nmoves = mtables[0][0].length;
|
|
582
595
|
let heuristic = 0;
|
|
583
596
|
for (let i = 0; i < ncoords; i++) {
|
|
584
597
|
heuristic = Math.max(heuristic, ptables[i][indices[i]]);
|
|
@@ -600,13 +613,13 @@ function* ida_search_gen(indices, mtables, ptables, bound, last) {
|
|
|
600
613
|
if (m < last && tetrad[m] === tetrad[last]) {
|
|
601
614
|
continue;
|
|
602
615
|
}
|
|
603
|
-
|
|
616
|
+
const new_indices = indices.slice();
|
|
604
617
|
for (let c = 0; c < ncoords; c++) {
|
|
605
618
|
new_indices[c] = mtables[c][indices[c]][m];
|
|
606
619
|
}
|
|
607
620
|
let r = 1;
|
|
608
621
|
while (indices.some((_, i) => indices[i] !== new_indices[i])) {
|
|
609
|
-
|
|
622
|
+
const subpath_gen = ida_search_gen(
|
|
610
623
|
new_indices,
|
|
611
624
|
mtables,
|
|
612
625
|
ptables,
|
|
@@ -614,7 +627,7 @@ function* ida_search_gen(indices, mtables, ptables, bound, last) {
|
|
|
614
627
|
m
|
|
615
628
|
);
|
|
616
629
|
while (true) {
|
|
617
|
-
|
|
630
|
+
const { value: subpath, done } = subpath_gen.next();
|
|
618
631
|
if (done) {
|
|
619
632
|
break;
|
|
620
633
|
}
|
|
@@ -1265,4 +1278,3 @@ export {
|
|
|
1265
1278
|
getRandomRediCubeScramble,
|
|
1266
1279
|
sgsDataFTO
|
|
1267
1280
|
};
|
|
1268
|
-
//# sourceMappingURL=search-dynamic-sgs-unofficial-WJZ2CWX5.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// src/cubing/vendor/mit/cs0x7f/min2phase/3x3x3-min2phase.
|
|
1
|
+
// src/cubing/vendor/mit/cs0x7f/min2phase/3x3x3-min2phase.ts
|
|
2
2
|
var $intern_3 = { 3: 1 };
|
|
3
3
|
var $intern_9 = 4194303;
|
|
4
4
|
var $intern_10 = 1048575;
|
|
@@ -2536,14 +2536,11 @@ var B_classLit = createForPrimitive("byte", "B");
|
|
|
2536
2536
|
var J_classLit = createForPrimitive("long", "J");
|
|
2537
2537
|
var C_classLit = createForPrimitive("char", "C");
|
|
2538
2538
|
createForClass("com.google.gwt.user.client.rpc", "XsrfToken", null), createForInterface("java.util", "Map/Entry");
|
|
2539
|
-
var initialize =
|
|
2539
|
+
var initialize = () => {
|
|
2540
2540
|
init_0(false);
|
|
2541
2541
|
};
|
|
2542
|
-
var solvePattern =
|
|
2543
|
-
return $solution(new Search(), s);
|
|
2544
|
-
};
|
|
2542
|
+
var solvePattern = (s) => $solution(new Search(), s);
|
|
2545
2543
|
export {
|
|
2546
2544
|
initialize,
|
|
2547
2545
|
solvePattern
|
|
2548
2546
|
};
|
|
2549
|
-
//# sourceMappingURL=search-dynamic-solve-3x3x3-B2L4IN34.js.map
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import "./chunk-
|
|
2
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-RDKH6CDA.js";
|
|
2
|
+
import "./chunk-NJ66FRKF.js";
|
|
3
3
|
import {
|
|
4
4
|
random333Scramble
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-QOLD6GH2.js";
|
|
6
|
+
import "./chunk-BHVTDDUY.js";
|
|
7
|
+
import "./chunk-6R47S6MP.js";
|
|
8
|
+
import "./chunk-IIJFVP3K.js";
|
|
9
|
+
import "./chunk-LBER75W4.js";
|
|
10
10
|
import {
|
|
11
11
|
Alg
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-QZK3M7IM.js";
|
|
13
|
+
|
|
14
|
+
// src/cubing/vendor/mit/cs0x7f/cstimer/src/js/scramble/444-solver.ts
|
|
15
|
+
import { randomUIntBelow } from "random-uint-below";
|
|
13
16
|
|
|
14
17
|
// src/cubing/vendor/mit/cs0x7f/cstimer/src/js/lib/mathlib.ts
|
|
15
18
|
var Cnk = [];
|
|
@@ -64,7 +67,6 @@ function set8Perm(arr, idx, n, even) {
|
|
|
64
67
|
}
|
|
65
68
|
|
|
66
69
|
// src/cubing/vendor/mit/cs0x7f/cstimer/src/js/scramble/444-solver.ts
|
|
67
|
-
import { randomUIntBelow } from "random-uint-below";
|
|
68
70
|
function createArray(length1, length2) {
|
|
69
71
|
const result = new Array(length1);
|
|
70
72
|
if (length2 !== void 0) {
|
|
@@ -2308,9 +2310,7 @@ function $doSearch(this$static) {
|
|
|
2308
2310
|
0
|
|
2309
2311
|
)
|
|
2310
2312
|
);
|
|
2311
|
-
p1SolsArr.sort(
|
|
2312
|
-
return a.value - b.value;
|
|
2313
|
-
});
|
|
2313
|
+
p1SolsArr.sort((a, b) => a.value - b.value);
|
|
2314
2314
|
MAX_LENGTH2 = 9;
|
|
2315
2315
|
do {
|
|
2316
2316
|
OUT: for (length12 = p1SolsArr[0].value; length12 < 100; ++length12) {
|
|
@@ -2338,9 +2338,7 @@ function $doSearch(this$static) {
|
|
|
2338
2338
|
}
|
|
2339
2339
|
++MAX_LENGTH2;
|
|
2340
2340
|
} while (length12 === 100);
|
|
2341
|
-
this$static.arr2.sort(
|
|
2342
|
-
return a.value - b.value;
|
|
2343
|
-
});
|
|
2341
|
+
this$static.arr2.sort((a, b) => a.value - b.value);
|
|
2344
2342
|
index = 0;
|
|
2345
2343
|
MAX_LENGTH3 = 13;
|
|
2346
2344
|
do {
|
|
@@ -2703,7 +2701,7 @@ function setClassLiteral(seedId, clazz) {
|
|
|
2703
2701
|
if (seed) {
|
|
2704
2702
|
proto = seed.prototype;
|
|
2705
2703
|
} else {
|
|
2706
|
-
seed = seedTable[seedId] =
|
|
2704
|
+
seed = seedTable[seedId] = () => {
|
|
2707
2705
|
};
|
|
2708
2706
|
seed.___clazz$ = clazz;
|
|
2709
2707
|
return;
|
|
@@ -2920,4 +2918,3 @@ export {
|
|
|
2920
2918
|
initialize,
|
|
2921
2919
|
random444Scramble
|
|
2922
2920
|
};
|
|
2923
|
-
//# sourceMappingURL=search-dynamic-solve-4x4x4-OLWUV6G6.js.map
|