cubing 0.24.5 → 0.25.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.
Files changed (77) hide show
  1. package/README.md +12 -5
  2. package/dist/esm/{2x2x2.sgs.json-EH524KJ3.js → 2x2x2.sgs.json-QKP2WRPT.js} +3 -3
  3. package/dist/esm/{2x2x2.sgs.json-EH524KJ3.js.map → 2x2x2.sgs.json-QKP2WRPT.js.map} +0 -0
  4. package/dist/esm/{3d-dynamic-inside-P5DSR3RN.js → 3d-dynamic-inside-GKERM3IG.js} +4 -4
  5. package/dist/esm/{3d-dynamic-inside-P5DSR3RN.js.map → 3d-dynamic-inside-GKERM3IG.js.map} +0 -0
  6. package/dist/esm/bluetooth/index.js +3 -3
  7. package/dist/esm/{chunk-T3IR6NP3.js → chunk-37NJ765B.js} +8 -6
  8. package/dist/esm/{chunk-T3IR6NP3.js.map → chunk-37NJ765B.js.map} +2 -2
  9. package/dist/esm/{chunk-62T523ZS.js → chunk-GXV3K7MX.js} +2 -2
  10. package/dist/esm/{chunk-62T523ZS.js.map → chunk-GXV3K7MX.js.map} +0 -0
  11. package/dist/esm/{chunk-IVWBK3I7.js → chunk-HCNUMBT5.js} +4 -4
  12. package/dist/esm/{chunk-IVWBK3I7.js.map → chunk-HCNUMBT5.js.map} +0 -0
  13. package/dist/esm/{chunk-BJIOROQC.js → chunk-L7W7Q42Q.js} +2 -2
  14. package/dist/esm/{chunk-BJIOROQC.js.map → chunk-L7W7Q42Q.js.map} +0 -0
  15. package/dist/esm/{chunk-63M53ZZ5.js → chunk-QMZKTP7F.js} +2 -2
  16. package/dist/esm/{chunk-63M53ZZ5.js.map → chunk-QMZKTP7F.js.map} +0 -0
  17. package/dist/esm/{chunk-S2IF3HZB.js → chunk-QUTXXRPT.js} +2 -2
  18. package/dist/esm/{chunk-S2IF3HZB.js.map → chunk-QUTXXRPT.js.map} +0 -0
  19. package/dist/esm/{chunk-37EHU3GZ.js → chunk-RENZB7QN.js} +4 -2
  20. package/dist/esm/chunk-RENZB7QN.js.map +7 -0
  21. package/dist/esm/{chunk-V5DHYMZ7.js → chunk-T5KQKRR3.js} +2 -2
  22. package/dist/esm/{chunk-V5DHYMZ7.js.map → chunk-T5KQKRR3.js.map} +0 -0
  23. package/dist/esm/{chunk-GBIDMAJS.js → chunk-TXTMBIUR.js} +2 -2
  24. package/dist/esm/{chunk-GBIDMAJS.js.map → chunk-TXTMBIUR.js.map} +0 -0
  25. package/dist/esm/{chunk-B27E6KTE.js → chunk-Y32HHZUY.js} +1 -1
  26. package/dist/esm/{chunk-B27E6KTE.js.map → chunk-Y32HHZUY.js.map} +2 -2
  27. package/dist/esm/{chunk-RQWADVHJ.js → chunk-Z5INA5XR.js} +6 -6
  28. package/dist/esm/{chunk-RQWADVHJ.js.map → chunk-Z5INA5XR.js.map} +0 -0
  29. package/dist/esm/{entry-5ASY5DZU.js → entry-RSZSKW5X.js} +43 -64
  30. package/dist/esm/{entry-5ASY5DZU.js.map → entry-RSZSKW5X.js.map} +3 -3
  31. package/dist/esm/esm-test-worker.js +1 -1
  32. package/dist/esm/{fto.sgs.json-ADHMZWSD.js → fto.sgs.json-T5WY2HR7.js} +3 -3
  33. package/dist/esm/{fto.sgs.json-ADHMZWSD.js.map → fto.sgs.json-T5WY2HR7.js.map} +0 -0
  34. package/dist/esm/ftosolver-smaller-phase3-table-UTQRO776.js +1537 -0
  35. package/dist/esm/ftosolver-smaller-phase3-table-UTQRO776.js.map +7 -0
  36. package/dist/esm/kpuzzle/index.js +1 -1
  37. package/dist/esm/masterpyra-QOJCNGZM.js +732 -0
  38. package/dist/esm/masterpyra-QOJCNGZM.js.map +7 -0
  39. package/dist/esm/{megaminx.sgs.json-6QTJOWQY.js → megaminx.sgs.json-KKR4VPHV.js} +3 -3
  40. package/dist/esm/{megaminx.sgs.json-6QTJOWQY.js.map → megaminx.sgs.json-KKR4VPHV.js.map} +0 -0
  41. package/dist/esm/{module-entry-HW3RWVEP.js → module-entry-UDFTQHXX.js} +3 -3
  42. package/dist/esm/{module-entry-HW3RWVEP.js.map → module-entry-UDFTQHXX.js.map} +0 -0
  43. package/dist/esm/{node-W3AD4HBK.js → node-KTVORTZB.js} +4 -2
  44. package/dist/esm/node-KTVORTZB.js.map +7 -0
  45. package/dist/esm/{node-SP4L2AKI.js → node-LMAS5PGZ.js} +4 -2
  46. package/dist/esm/node-LMAS5PGZ.js.map +7 -0
  47. package/dist/esm/protocol/index.js +2 -2
  48. package/dist/esm/puzzles/index.js +2 -2
  49. package/dist/esm/{pyraminx.sgs.json-W4FJVYCV.js → pyraminx.sgs.json-5HPDQAOM.js} +4 -4
  50. package/dist/esm/{pyraminx.sgs.json-W4FJVYCV.js.map → pyraminx.sgs.json-5HPDQAOM.js.map} +0 -0
  51. package/dist/esm/scramble/index.js +5 -5
  52. package/dist/esm/{scramble_444-QBE4UGPU.js → scramble_444-FXLLIDCW.js} +5 -5
  53. package/dist/esm/{scramble_444-QBE4UGPU.js.map → scramble_444-FXLLIDCW.js.map} +0 -0
  54. package/dist/esm/{scramble_sq1-PQ2AYBFW.js → scramble_sq1-OZR6K4WV.js} +2 -2
  55. package/dist/esm/{scramble_sq1-PQ2AYBFW.js.map → scramble_sq1-OZR6K4WV.js.map} +0 -0
  56. package/dist/esm/search/index.js +5 -5
  57. package/dist/esm/{skewb.sgs.json-PE7DQP2D.js → skewb.sgs.json-MWONK6HT.js} +3 -3
  58. package/dist/esm/{skewb.sgs.json-PE7DQP2D.js.map → skewb.sgs.json-MWONK6HT.js.map} +0 -0
  59. package/dist/esm/twisty/index.js +12 -3
  60. package/dist/esm/twisty/index.js.map +2 -2
  61. package/dist/esm/worker-inside-generated-string-WGUQ4QSO.js +2828 -0
  62. package/dist/esm/worker-inside-generated-string-WGUQ4QSO.js.map +7 -0
  63. package/dist/types/puzzles/async/async-pg3d.d.ts +2 -0
  64. package/dist/types/search/inside/solve/puzzles/fto.d.ts +1 -1
  65. package/dist/types/search/inside/solve/puzzles/master_tetraminx.d.ts +2 -0
  66. package/dist/types/search/worker-inside-generated-string.d.ts +1 -1
  67. package/dist/types/vendor/xyzzy/ftosolver-smaller-phase3-table.d.ts +1 -0
  68. package/dist/types/vendor/xyzzy/ftosolver.d.ts +203 -0
  69. package/dist/types/vendor/xyzzy/kilosolver.d.ts +140 -0
  70. package/dist/types/vendor/xyzzy/masterpyra.d.ts +1 -0
  71. package/dist/types/vendor/xyzzy/rediscrambler.d.ts +94 -0
  72. package/package.json +2 -2
  73. package/dist/esm/chunk-37EHU3GZ.js.map +0 -7
  74. package/dist/esm/node-SP4L2AKI.js.map +0 -7
  75. package/dist/esm/node-W3AD4HBK.js.map +0 -7
  76. package/dist/esm/worker-inside-generated-string-XYHIVIPG.js +0 -3447
  77. package/dist/esm/worker-inside-generated-string-XYHIVIPG.js.map +0 -7
@@ -0,0 +1 @@
1
+ export function randomFTOScrambleString(): Promise<any>;
@@ -0,0 +1,203 @@
1
+ declare function counter(A: any): any[];
2
+ declare function counter(A: any): any[];
3
+ declare function counter(A: any): any[];
4
+ declare function factorial(n: any): any;
5
+ declare function factorial(n: any): any;
6
+ declare function factorial(n: any): any;
7
+ declare function C(n: any, k: any): number;
8
+ declare function C(n: any, k: any): number;
9
+ declare function C(n: any, k: any): number;
10
+ declare function C4(n: any, k0: any, k1: any, k2: any, k3?: number): number;
11
+ declare function permutation_to_index(perm: any): number;
12
+ declare function permutation_to_index(perm: any): number;
13
+ declare function permutation_to_index(perm: any): number;
14
+ declare function index_to_permutation(ind: any, n: any): number[];
15
+ declare function index_to_permutation(ind: any, n: any): number[];
16
+ declare function index_to_permutation(ind: any, n: any): number[];
17
+ declare function permutation_parity(A: any): number;
18
+ declare function permutation_parity(A: any): number;
19
+ declare function permutation_parity(A: any): number;
20
+ declare function index_to_evenpermutation(ind: any, n: any): number[];
21
+ declare function index_to_evenpermutation(ind: any, n: any): number[];
22
+ declare function index_to_evenpermutation(ind: any, n: any): number[];
23
+ declare function evenpermutation_to_index(perm: any): number;
24
+ declare function evenpermutation_to_index(perm: any): number;
25
+ declare function evenpermutation_to_index(perm: any): number;
26
+ declare function random_permutation(n: any): number[];
27
+ declare function random_even_permutation(n: any): number[];
28
+ declare function comb_to_index(l: any): number;
29
+ declare function comb_to_index(l: any): number;
30
+ declare function comb_to_index(l: any): number;
31
+ declare function index_to_comb(ind: any, ones: any, bits: any): any[];
32
+ declare function index_to_comb(ind: any, ones: any, bits: any): any[];
33
+ declare function index_to_comb(ind: any, ones: any, bits: any): any[];
34
+ declare function ctz(n: any): number;
35
+ declare function generate_comb_lookup_tables(n: any, k: any): any;
36
+ declare function popcount(n: any): number;
37
+ declare function spread_bits(n: any): any;
38
+ declare function interleave_bits(x: any, y: any): number;
39
+ declare function generate_comb4_lookup_tables(n: any, k0: any, k1: any, k2: any, k3: any): any;
40
+ declare function compose(A: any, B: any): any[];
41
+ declare function compose(A: any, B: any): any[];
42
+ declare function compose(A: any, B: any): any[];
43
+ declare function compose3(A: any, B: any, C: any): any[];
44
+ declare function compose_o(A: any, B: any): any[][];
45
+ declare function compose_o(A: any, B: any): any[][];
46
+ declare function permutation_from_cycles(cycles: any, n: any): any[];
47
+ declare function reduce_permutation(perm: any, keep: any): any[];
48
+ declare function invert_permutation(perm: any): any[];
49
+ declare function gcd(a: any, b: any): number;
50
+ declare function lcm(a: any, b: any): number;
51
+ declare function permutation_order(perm: any): number;
52
+ declare function identify_corner_piece(colourA: any, colourB: any): number[];
53
+ declare function identify_edge_piece(colourA: any, colourB: any): number;
54
+ declare function get_corner_piece(facelets: any, location: any): number[];
55
+ declare function get_edge_piece(facelets: any, location: any): number;
56
+ declare function set_corner_piece(facelets: any, location: any, value: any, orientation: any): void;
57
+ declare function set_edge_piece(facelets: any, location: any, value: any): void;
58
+ declare function convert_move_to_permutations(move: any): {
59
+ cp: number[];
60
+ ep: number[];
61
+ ap: number[];
62
+ bp: number[];
63
+ };
64
+ declare function random_state(): any[];
65
+ declare function random_state(): any[][];
66
+ declare function stringify_move_sequence(move_sequence: any, no_wide?: boolean): any;
67
+ declare function stringify_move_sequence(move_sequence: any): any;
68
+ declare function stringify_move_sequence(move_sequence: any): any;
69
+ declare function print_move_sequence(move_sequence: any): void;
70
+ declare function print_move_sequence(move_sequence: any): void;
71
+ declare function print_move_sequence(move_sequence: any): void;
72
+ declare function apply_move_sequence(state: any, move_sequence: any): any;
73
+ declare function apply_move_sequence(state: any, move_sequence: any): any;
74
+ declare function apply_move_sequence(state: any, move_sequence: any): any;
75
+ declare function invert_move_sequence(move_sequence: any): any;
76
+ declare function simplify_move_sequence(move_sequence: any, make_noise?: boolean): any[][];
77
+ declare function generate_random_state_scramble(): any;
78
+ declare function generate_random_state_scramble(): any;
79
+ declare function generate_random_state_scramble(): any;
80
+ declare function generate_multiple_random_state_scrambles(n: any): any[];
81
+ declare function generate_mtable_comb_generic(n: any, k: any, permutations: any): Uint32Array[];
82
+ declare function generate_mtable_comb4_generic(n: any, k0: any, k1: any, k2: any, k3: any, permutations: any): Uint32Array[];
83
+ declare function generate_mtable_single_generic(permutations: any): Uint32Array[];
84
+ declare function combine_mtables(mtable0: any, mtable1: any): Uint32Array[];
85
+ declare function trim_unreachable(mtable: any, origin: any): any[];
86
+ declare function reduce_to_quotient(mtable: any, origins: any): (Int32Array | Int32Array[])[];
87
+ declare function generate_mirrored_coordinate_table(mtable: any, a: any, b: any): Int32Array;
88
+ declare function bfs(mtable: any, goal_states: any): Int8Array;
89
+ declare function bfs(mtable: any, goal_states: any): any[];
90
+ declare function bfs(mtable: any, goal_states: any): any[];
91
+ declare function ida_solve_gen(indices: any, mtables: any, ptables: any, moves_left: any, commute: any): Generator<any, void, any>;
92
+ declare function ida_solve_gen(indices: any, mtables: any, ptables: any): Generator<any, void, any>;
93
+ declare function ida_search_gen(indices: any, mtables: any, ptables: any, bound: any, last: any, commute: any): any;
94
+ declare function ida_search_gen(indices: any, mtables: any, ptables: any, bound: any, last: any): any;
95
+ declare function solve(facelets: any, readable?: boolean): any[][];
96
+ declare function solve(state: any): any[];
97
+ declare function solve(state: any): any;
98
+ declare function index_phase1(facelets: any): any[];
99
+ declare function index_phase1(state: any): number[];
100
+ declare function generate_phase1_edge_mtable(): any;
101
+ declare function generate_phase1_edge_mtable(): any;
102
+ declare function generate_phase1_edge_ptable(): any;
103
+ declare function generate_phase1_edge_ptable(): any;
104
+ declare function generate_phase1_centreA_mtable(): any;
105
+ declare function generate_phase1_centreB_mtable(): any;
106
+ declare function generate_phase1_centre_ptable(): any;
107
+ declare function solve_phase1_gen(facelets: any): Generator<any, void, any>;
108
+ declare function phase1_ida_solve_gen(indices: any, mtables: any, ptables: any, moves_left: any): Generator<any, void, any>;
109
+ declare function phase1_ida_search_gen(indices: any, mtables: any, ptables: any, bound: any, last: any): any;
110
+ declare function index_phase2(facelets: any): any[];
111
+ declare function index_phase2(state: any): number[];
112
+ declare function solve_phase2_gen(facelets: any): Generator<any, void, any>;
113
+ declare function solve_phase2(facelets: any): any;
114
+ declare function solve_phase2(state: any): any;
115
+ declare function generate_phase2_centre_mtables(): any;
116
+ declare function generate_phase2_edge_mtable(): any;
117
+ declare function generate_phase2_edge_mtable(): any;
118
+ declare function generate_phase2_corner_mtable(): any;
119
+ declare function generate_phase2_corner_mtable(): any;
120
+ declare function generate_phase2_corner_mtable_compact(): any;
121
+ declare function generate_phase2_ce_mtable(): any;
122
+ declare function generate_phase2_ce_mirror_map(): any;
123
+ declare function phase2_centre_goal_states(): any;
124
+ declare function phase2_corner_goal_states(): number[];
125
+ declare function generate_phase2_ace_ptable(): any;
126
+ declare function phase2_ida_solve_gen(indices: any, moves_left: any): Generator<any, void, any>;
127
+ declare function phase2_ida_search_gen(a: any, b: any, ce: any, mtable_a: any, mtable_b: any, mtable_ce: any, ptable_ace: any, mirror_map: any, bound: any, last: any): any;
128
+ declare function index_phase3_2gen(facelets: any): any[];
129
+ declare function generate_phase3_2gen_edge_mtable(): any;
130
+ declare function generate_phase3_2gen_corner_mtable(): any;
131
+ declare function generate_phase3_2gen_corneredge_mtable(): any;
132
+ declare function generate_phase3_2gen_centre_mtable(): any;
133
+ declare function generate_phase3_2gen_depth_table(): any;
134
+ declare function solve_phase3_2gen(facelets: any, indices?: any[], simplify?: boolean): any[];
135
+ declare function solve_phase3_2gen_readable(facelets: any, indices?: any[]): any[][] | undefined;
136
+ declare function alternation_penalty(x: any): number;
137
+ declare function grade_readability(seq: any): any;
138
+ declare function alternations(seq: any): number[];
139
+ declare function solve_phase3_2gen_ida(ab: any, ce: any, mtable_ab: any, mtable_ce: any, depth_table: any, bound: any, last?: number): any;
140
+ declare function solve_phase2_and_phase3_fast(facelets: any, phase2_attempts?: number, cap?: number): any;
141
+ declare function solve_phase2_and_phase3_readable(facelets: any, phase2_attempts?: number, cap?: number): any[][] | undefined;
142
+ declare function phase3_benchmark(solver?: typeof solve_phase3_2gen): void;
143
+ declare function solver_benchmark(solver?: typeof solve): void;
144
+ declare namespace rng {
145
+ export { next };
146
+ export const is_crypto: boolean;
147
+ }
148
+ declare function evenpermutation8_to_index(perm: any): number;
149
+ declare function index_to_evenpermutation8(ind: any, perm: any): any;
150
+ declare let comb_lookup_tables: {};
151
+ declare let comb4_lookup_tables: {};
152
+ declare let solved_state: number[];
153
+ declare let move_U: any[];
154
+ declare let move_Ui: any[];
155
+ declare let move_X: number[];
156
+ declare let move_Y: number[];
157
+ declare let move_Z: number[];
158
+ declare let move_L: any[];
159
+ declare let move_F: any[];
160
+ declare let move_R: any[];
161
+ declare let move_Us: any[];
162
+ declare let move_Uw: any[];
163
+ declare let move_Uwi: any[];
164
+ declare let move_Lw: any[];
165
+ declare let move_Fw: any[];
166
+ declare let move_Rw: any[];
167
+ declare let colour_map: number[];
168
+ declare let corner_piece_facelets: number[][];
169
+ declare let edge_piece_facelets: number[][];
170
+ declare let centreA_piece_facelets: number[];
171
+ declare let centreB_piece_facelets: number[];
172
+ declare let moves: any[][];
173
+ declare let move_names: string[];
174
+ declare let move_permutations: {
175
+ cp: number[];
176
+ ep: number[];
177
+ ap: number[];
178
+ bp: number[];
179
+ }[];
180
+ declare let cached_mtables: {};
181
+ declare let cached_ptables: {};
182
+ declare let phase1_centre_colour_map: number[];
183
+ declare let phase2_centre_colour_map: number[];
184
+ declare let phase2_centre_indices: number[];
185
+ declare let phase2_keep: boolean[];
186
+ declare let phase2_corner_keep: boolean[];
187
+ declare let phase2_edge_reduction_map: any;
188
+ declare let phase2_corner_reduction_map: any;
189
+ declare let phase2_ce_mirror_map: any;
190
+ declare let phase3_2gen_centre_indices: number[];
191
+ declare let phase3_2gen_keep: boolean[];
192
+ declare let phase3_2gen_move_seqs: number[][][];
193
+ declare let phase3_2gen_nmoves: number;
194
+ declare let phase3_2gen_facelet_permutations: any[];
195
+ declare let phase3_2gen_piece_permutations: {
196
+ cp: number[];
197
+ ep: number[];
198
+ ap: number[];
199
+ bp: number[];
200
+ }[];
201
+ declare let phase3_2gen_move_orders: number[];
202
+ declare let phase3_2gen_depth_table: any;
203
+ declare function next(bound: any): number | undefined;
@@ -0,0 +1,140 @@
1
+ declare function counter(A: any): any[];
2
+ declare function counter(A: any): any[];
3
+ declare function counter(A: any): any[];
4
+ declare function factorial(n: any): any;
5
+ declare function factorial(n: any): any;
6
+ declare function factorial(n: any): any;
7
+ declare function C(n: any, k: any): number;
8
+ declare function C(n: any, k: any): number;
9
+ declare function C(n: any, k: any): number;
10
+ declare function permutation_to_index(perm: any): number;
11
+ declare function permutation_to_index(perm: any): number;
12
+ declare function permutation_to_index(perm: any): number;
13
+ declare function index_to_permutation(ind: any, n: any): number[];
14
+ declare function index_to_permutation(ind: any, n: any): number[];
15
+ declare function index_to_permutation(ind: any, n: any): number[];
16
+ declare function permutation_parity(A: any): number;
17
+ declare function permutation_parity(A: any): number;
18
+ declare function permutation_parity(A: any): number;
19
+ declare function index_to_evenpermutation(ind: any, n: any): number[];
20
+ declare function index_to_evenpermutation(ind: any, n: any): number[];
21
+ declare function index_to_evenpermutation(ind: any, n: any): number[];
22
+ declare function evenpermutation_to_index(perm: any): number;
23
+ declare function evenpermutation_to_index(perm: any): number;
24
+ declare function evenpermutation_to_index(perm: any): number;
25
+ declare function comb_to_index(l: any): number;
26
+ declare function comb_to_index(l: any): number;
27
+ declare function comb_to_index(l: any): number;
28
+ declare function index_to_comb(ind: any, ones: any, bits: any): any[];
29
+ declare function index_to_comb(ind: any, ones: any, bits: any): any[];
30
+ declare function index_to_comb(ind: any, ones: any, bits: any): any[];
31
+ declare function compose(A: any, B: any): any[];
32
+ declare function compose(A: any, B: any): any[];
33
+ declare function compose(A: any, B: any): any[];
34
+ declare function compose_o(A: any, B: any): any[][];
35
+ declare function compose_o(A: any, B: any): any[][];
36
+ declare function permutation_from_cycle(cycle: any, n: any): any[];
37
+ declare function permutation_from_cycle(cycle: any, n: any): any[];
38
+ declare function unsparsify_list(d: any, n: any): any[];
39
+ declare function unsparsify_list(d: any, n: any): any[];
40
+ declare function random_state(): any[];
41
+ declare function random_state(): any[][];
42
+ declare function stringify_move_sequence(move_sequence: any, no_wide?: boolean): any;
43
+ declare function stringify_move_sequence(move_sequence: any): any;
44
+ declare function stringify_move_sequence(move_sequence: any): any;
45
+ declare function print_move_sequence(move_sequence: any): void;
46
+ declare function print_move_sequence(move_sequence: any): void;
47
+ declare function print_move_sequence(move_sequence: any): void;
48
+ declare function apply_move_sequence(state: any, move_sequence: any): any;
49
+ declare function apply_move_sequence(state: any, move_sequence: any): any;
50
+ declare function apply_move_sequence(state: any, move_sequence: any): any;
51
+ declare function generate_random_state_scramble(): any;
52
+ declare function generate_random_state_scramble(): any;
53
+ declare function generate_random_state_scramble(): any;
54
+ declare function generate_random_move_scramble(M: any, N: any): number[][];
55
+ declare function map_piece_to_face(loc: any, ori: any): string;
56
+ declare function create_svg_template(state: any, colour_scheme: any): Element;
57
+ declare function draw_state(svgel: any, state: any, colour_scheme: any): any;
58
+ declare function solve_phase1(state: any): any;
59
+ declare function search_phase1(flags: any, depth: any, last: any): any;
60
+ declare function index_phase2(facelets: any): any[];
61
+ declare function index_phase2(state: any): number[];
62
+ declare function solve_phase2(facelets: any): any;
63
+ declare function solve_phase2(state: any): any;
64
+ declare function index_phase3(state: any): number[];
65
+ declare function solve_phase3(state: any): any;
66
+ declare function index_phase4(state: any): number[];
67
+ declare function solve_phase4(state: any): any;
68
+ declare function solve_phase4_fast(state: any): any;
69
+ declare function solve(facelets: any, readable?: boolean): any[][];
70
+ declare function solve(state: any): any[];
71
+ declare function solve(state: any): any;
72
+ declare function cn_solve(state: any): any;
73
+ declare function generate_phase23_orientation_mtable(): any;
74
+ declare function generate_phase2_orientation_ptable(): any;
75
+ declare function generate_phase3_orientation_ptable(): any;
76
+ declare function generate_phase23_permutation_mtable(): any;
77
+ declare function generate_phase2_permutation_ptable(): any;
78
+ declare function generate_phase3_permutation_ptable(): any;
79
+ declare function generate_phase4_orientation_mtable(): any;
80
+ declare function generate_phase4_permutation_mtable(): any;
81
+ declare function generate_phase4_orientation_ptable(): any;
82
+ declare function generate_phase4_permutation_ptable(): any;
83
+ declare function generate_phase4_near_ptable_list(threshold: any): any;
84
+ declare function binary_search(A: any, x: any): boolean;
85
+ declare function cache_all_tables(): void;
86
+ declare function bfs(mtable: any, goal_states: any): Int8Array;
87
+ declare function bfs(mtable: any, goal_states: any): any[];
88
+ declare function bfs(mtable: any, goal_states: any): any[];
89
+ declare function ida_solve(indices: any, mtables: any, ptables: any): any;
90
+ declare function ida_solve(indices: any, mtables: any, ptables: any, max_bound: any): any;
91
+ declare function ida_search(indices: any, mtables: any, ptables: any, bound: any, last: any): number[][] | undefined;
92
+ declare function ida_search(indices: any, mtables: any, ptables: any, bound: any, last: any): any;
93
+ declare function phase4_ida_solve(indices: any): any;
94
+ declare function phase4_ida_search(indices: any, bound: any, last: any, mtable_o: any, mtable_p: any, ptable_o: any, ptable_p: any, ptable_n: any): any;
95
+ declare function phase4_ida_solve_gen(indices: any): Generator<any, void, any>;
96
+ declare function phase4_ida_search_gen(indices: any, bound: any, last: any, mtable_o: any, mtable_p: any, ptable_o: any, ptable_p: any, ptable_n: any): any;
97
+ declare function generate_hs_mtable(): any;
98
+ declare function generate_hs_u_ptable(): any;
99
+ declare function generate_hs_d_ptable(): any;
100
+ declare function index_hs(state: any): number[];
101
+ declare function solve_hs(state: any): any;
102
+ declare function solve_hs_twophase(state: any): any;
103
+ declare function generate_hybrid_scramble(): any[][];
104
+ declare function generate_fullseparate_mtable(): any;
105
+ declare function generate_fullseparate_ptable(): any;
106
+ declare function bfs5(mtable: any, goal_states: any): any[];
107
+ declare let PHASE4_THRESHOLD: number;
108
+ declare function evenpermutation10_to_index(perm: any): number;
109
+ declare function index_to_evenpermutation10(ind: any, perm: any): any;
110
+ declare let move_U: any[][];
111
+ declare let move_R: any[][];
112
+ declare let move_F: any[][];
113
+ declare let move_L: any[][];
114
+ declare let move_BL: any[][];
115
+ declare let move_BR: any[][];
116
+ declare let move_x2: any[][];
117
+ declare let move_y: any[][];
118
+ declare let move_rot: number[][];
119
+ declare let moves: any[][];
120
+ declare let move_names: string[];
121
+ declare let id: any[][];
122
+ declare let moves_full: any[];
123
+ declare namespace default_colour_scheme {
124
+ const U: string;
125
+ const L: string;
126
+ const F: string;
127
+ const R: string;
128
+ const BR: string;
129
+ const BL: string;
130
+ const DBR: string;
131
+ const DB: string;
132
+ const DBL: string;
133
+ const DFL: string;
134
+ const DFR: string;
135
+ const D: string;
136
+ }
137
+ declare let face_names: string[];
138
+ declare let rotation_amounts: number[][];
139
+ declare let translation_amounts: any;
140
+ declare let tables: {};
@@ -0,0 +1 @@
1
+ export function randomMasterTetraminxScrambleString(): Promise<any>;
@@ -0,0 +1,94 @@
1
+ declare function counter(A: any): any[];
2
+ declare function counter(A: any): any[];
3
+ declare function counter(A: any): any[];
4
+ declare function factorial(n: any): any;
5
+ declare function factorial(n: any): any;
6
+ declare function factorial(n: any): any;
7
+ declare function C(n: any, k: any): number;
8
+ declare function C(n: any, k: any): number;
9
+ declare function C(n: any, k: any): number;
10
+ declare function permutation_to_index(perm: any): number;
11
+ declare function permutation_to_index(perm: any): number;
12
+ declare function permutation_to_index(perm: any): number;
13
+ declare function index_to_permutation(ind: any, n: any): number[];
14
+ declare function index_to_permutation(ind: any, n: any): number[];
15
+ declare function index_to_permutation(ind: any, n: any): number[];
16
+ declare function permutation_parity(A: any): number;
17
+ declare function permutation_parity(A: any): number;
18
+ declare function permutation_parity(A: any): number;
19
+ declare function index_to_evenpermutation(ind: any, n: any): number[];
20
+ declare function index_to_evenpermutation(ind: any, n: any): number[];
21
+ declare function index_to_evenpermutation(ind: any, n: any): number[];
22
+ declare function evenpermutation_to_index(perm: any): number;
23
+ declare function evenpermutation_to_index(perm: any): number;
24
+ declare function evenpermutation_to_index(perm: any): number;
25
+ declare function comb_to_index(l: any): number;
26
+ declare function comb_to_index(l: any): number;
27
+ declare function comb_to_index(l: any): number;
28
+ declare function index_to_comb(ind: any, ones: any, bits: any): any[];
29
+ declare function index_to_comb(ind: any, ones: any, bits: any): any[];
30
+ declare function index_to_comb(ind: any, ones: any, bits: any): any[];
31
+ declare function compose(A: any, B: any): any[];
32
+ declare function compose(A: any, B: any): any[];
33
+ declare function compose(A: any, B: any): any[];
34
+ declare function permutation_from_cycle(cycle: any, n: any): any[];
35
+ declare function permutation_from_cycle(cycle: any, n: any): any[];
36
+ declare function unsparsify_list(d: any, n: any): any[];
37
+ declare function unsparsify_list(d: any, n: any): any[];
38
+ declare function compose_state(state1: any, state2: any): any[][];
39
+ declare function apply_move_sequence(state: any, move_sequence: any): any;
40
+ declare function apply_move_sequence(state: any, move_sequence: any): any;
41
+ declare function apply_move_sequence(state: any, move_sequence: any): any;
42
+ declare function stringify_move_sequence(move_sequence: any, no_wide?: boolean): any;
43
+ declare function stringify_move_sequence(move_sequence: any): any;
44
+ declare function stringify_move_sequence(move_sequence: any): any;
45
+ declare function print_move_sequence(move_sequence: any): void;
46
+ declare function print_move_sequence(move_sequence: any): void;
47
+ declare function print_move_sequence(move_sequence: any): void;
48
+ declare function generate_random_state(): any[][];
49
+ declare function generate_random_state_scramble(): any;
50
+ declare function generate_random_state_scramble(): any;
51
+ declare function generate_random_state_scramble(): any;
52
+ declare function generate_scramble_sequence(): any;
53
+ declare function solve(facelets: any, readable?: boolean): any[][];
54
+ declare function solve(state: any): any[];
55
+ declare function solve(state: any): any;
56
+ declare function index_phase1(facelets: any): any[];
57
+ declare function index_phase1(state: any): number[];
58
+ declare function generate_phase1_corner_mtable(): any;
59
+ declare function generate_phase1_corner_ptable(): any;
60
+ declare function generate_phase1_edge_mtable(): any;
61
+ declare function generate_phase1_edge_mtable(): any;
62
+ declare function generate_phase1_edge_ptable(): any;
63
+ declare function generate_phase1_edge_ptable(): any;
64
+ declare function generate_phase1_separate_mtable(): any;
65
+ declare function generate_phase1_separate_ptable(): any;
66
+ declare function generate_phase2_corner_mtable(): any;
67
+ declare function generate_phase2_corner_mtable(): any;
68
+ declare function generate_phase2_edge_mtable(): any;
69
+ declare function generate_phase2_edge_mtable(): any;
70
+ declare function generate_phase2_edge_ptable(): any;
71
+ declare function bfs(mtable: any, goal_states: any): Int8Array;
72
+ declare function bfs(mtable: any, goal_states: any): any[];
73
+ declare function bfs(mtable: any, goal_states: any): any[];
74
+ declare function ida_solve(indices: any, mtables: any, ptables: any): any;
75
+ declare function ida_solve(indices: any, mtables: any, ptables: any, max_bound: any): any;
76
+ declare function ida_search(indices: any, mtables: any, ptables: any, bound: any, last: any): number[][] | undefined;
77
+ declare function ida_search(indices: any, mtables: any, ptables: any, bound: any, last: any): any;
78
+ declare function ida_solve_gen(indices: any, mtables: any, ptables: any, moves_left: any, commute: any): Generator<any, void, any>;
79
+ declare function ida_solve_gen(indices: any, mtables: any, ptables: any): Generator<any, void, any>;
80
+ declare function ida_search_gen(indices: any, mtables: any, ptables: any, bound: any, last: any, commute: any): any;
81
+ declare function ida_search_gen(indices: any, mtables: any, ptables: any, bound: any, last: any): any;
82
+ declare let move_L: any[][];
83
+ declare let move_B: any[][];
84
+ declare let move_R: any[][];
85
+ declare let move_F: any[][];
86
+ declare let move_l: any[][];
87
+ declare let move_b: any[][];
88
+ declare let move_r: any[][];
89
+ declare let move_f: any[][];
90
+ declare let solved: any[][];
91
+ declare let moves: any[][];
92
+ declare let move_names: string[];
93
+ declare let tetrad: number[];
94
+ declare let tables: {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cubing",
3
- "version": "0.24.5",
3
+ "version": "0.25.1",
4
4
  "description": "A collection of JavaScript cubing libraries.",
5
5
  "author": "The js.cubing.net team",
6
6
  "type": "module",
@@ -32,7 +32,7 @@
32
32
  "jszip": "^3.5.0",
33
33
  "peggy": "^1.1.0",
34
34
  "prettier": "^2.2.1",
35
- "puppeteer": "^13.1.1",
35
+ "puppeteer": "^13.1.2",
36
36
  "typescript": "^4.5.4",
37
37
  "yargs": "^16.2.0"
38
38
  },
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/cubing/vendor/random-uint-below/get-random-values.ts", "../../src/cubing/vendor/random-uint-below/random53BitValue.ts", "../../src/cubing/vendor/random-uint-below/random-choice.ts", "../../src/cubing/vendor/random-uint-below/index.ts"],
4
- "sourcesContent": ["export type GetRandomValuesFunction = (arr: Uint32Array) => void;\n\n// This is a workaround for a `node` segfault.\n// In theory, imports are cached and safe to import multiple times: https://nodejs.org/api/esm.html#esm_urls\n// In practice, a rapid series of inline imports inside a worker causes a segfault(!) in `node`.\n// So we cache a single import reference. We avoid populating it until we first need it, so that we don't attempt to perform the import in environments that don't need or have it (e.g. browsers, `deno`).\nlet cryptoPromise: Promise<typeof import(\"crypto\")> | null = null;\n\n// `@types/node` is... lacking. This type may cause an error in the future, at which point we can hopefully use `@types/node` directly.\ntype NodeWebCrypto = typeof import(\"crypto\").webcrypto & {\n getRandomValues: GetRandomValuesFunction;\n};\n\n// We could use top-level await to define this more statically, but that has limited transpilation support.\nexport async function getRandomValuesFactory(): Promise<GetRandomValuesFunction> {\n if (!globalThis?.crypto?.getRandomValues) {\n const nodeWebcrypto = (await (cryptoPromise ??= import(\"crypto\")))\n .webcrypto as NodeWebCrypto;\n return nodeWebcrypto.getRandomValues;\n } else {\n return crypto.getRandomValues.bind(crypto) as GetRandomValuesFunction;\n }\n}\n", "import {\n getRandomValuesFactory,\n GetRandomValuesFunction,\n} from \"./get-random-values\";\n\n/*\n * randomInt.below(max) returns a random non-negative integer less than max (0 <= output < max).\n * `max` must be at most 2^53.\n */\n\nconst MAX_JS_PRECISE_INT = 9007199254740992;\n\nconst UPPER_HALF_MULTIPLIER = 2097152; // 2^21. We have to use multiplication because bit shifts truncate to 32 bits.\nconst LOWER_HALF_DIVIDER = 2048;\n\nfunction random53BitValue(getRandomValues: GetRandomValuesFunction): number {\n // Construct a random 53-bit value from a 32-bit upper half and a 21-bit lower half.\n const arr = new Uint32Array(2);\n getRandomValues(arr);\n const upper = arr[0];\n const lower = arr[1];\n return (\n Math.floor(upper * UPPER_HALF_MULTIPLIER) +\n Math.floor(lower / LOWER_HALF_DIVIDER)\n );\n}\n\nfunction validateMax(max: number): void {\n if (typeof max !== \"number\" || max < 0 || Math.floor(max) !== max) {\n throw new Error(\n \"randomInt.below() not called with a positive integer value.\",\n );\n }\n if (max > MAX_JS_PRECISE_INT) {\n throw new Error(\n `Called randomInt.below() with max == ${max}, which is larger than JavaScript can handle with integer precision.`,\n );\n }\n}\n\n// TODO: cache generated `randomUIntBelow`?\nexport async function randomUIntBelowFactory(): Promise<\n (max: number) => number\n> {\n const getRandomValues = await getRandomValuesFactory();\n const randomUIntBelow = (max: number): number => {\n validateMax(max);\n\n const val = random53BitValue(getRandomValues);\n const maxUniformSamplingRange = Math.floor(MAX_JS_PRECISE_INT / max) * max;\n\n // Rejection sampling:\n if (val < maxUniformSamplingRange) {\n return val % max;\n } else {\n // val % max would produce a biased result. This bias an be very bad if `max` is on the order of MAX_JS_PRECISE_INT. We have to try again, so just call ourselves recursively.\n // For some values of `max` just above 9007199254740992 / 2, this happens about once on average. For other values of `max`, it's less than that (and for small values of `max` it's extremely unlikely).\n\n // TODO: Use more bits of accuracy instead of rejection sampling to avoid DoS.\n return randomUIntBelow(max);\n }\n };\n return randomUIntBelow;\n}\n", "import { randomUIntBelowFactory } from \"./random53BitValue\";\n\n// Inspired by https://reference.wolfram.com/language/ref/RandomChoice.html\n// This library itself should be kept small, but a wrapper library may want to implement selecting multiple element without replacement as with replacement:\n// https://reference.wolfram.com/language/ref/RandomSample.html\nexport async function randomChoiceFactory<T>(): Promise<(arr: Array<T>) => T> {\n const randomUIntBelow = await randomUIntBelowFactory();\n return (arr: Array<T>): T => arr[randomUIntBelow(arr.length)];\n}\n", "export { randomChoiceFactory } from \"./random-choice\";\nexport { randomUIntBelowFactory } from \"./random53BitValue\";\n\n// TODO: reuse factory properly, move this to a separate file, add to impl.\nimport { randomUIntBelowFactory } from \"./random53BitValue\";\nconst randomUIntBelowPromise = randomUIntBelowFactory();\nexport async function randomPermute<T>(list: T[]): Promise<void> {\n for (let i = 1; i < list.length; i++) {\n const j = (await randomUIntBelowPromise)(i);\n [list[i], list[j]] = [list[j], list[i]];\n }\n}\n"],
5
- "mappings": ";AAMA,IAAI,gBAAyD;AAQ7D,wCAAiF;AAC/E,MAAI,CAAC,YAAY,QAAQ,iBAAiB;AACxC,UAAM,gBAAiB,OAAO,mCAAkB,OAAO,aACpD;AACH,WAAO,cAAc;AAAA,SAChB;AACL,WAAO,OAAO,gBAAgB,KAAK;AAAA;AAAA;;;ACVvC,IAAM,qBAAqB;AAE3B,IAAM,wBAAwB;AAC9B,IAAM,qBAAqB;AAE3B,0BAA0B,iBAAkD;AAE1E,QAAM,MAAM,IAAI,YAAY;AAC5B,kBAAgB;AAChB,QAAM,QAAQ,IAAI;AAClB,QAAM,QAAQ,IAAI;AAClB,SACE,KAAK,MAAM,QAAQ,yBACnB,KAAK,MAAM,QAAQ;AAAA;AAIvB,qBAAqB,KAAmB;AACtC,MAAI,OAAO,QAAQ,YAAY,MAAM,KAAK,KAAK,MAAM,SAAS,KAAK;AACjE,UAAM,IAAI,MACR;AAAA;AAGJ,MAAI,MAAM,oBAAoB;AAC5B,UAAM,IAAI,MACR,wCAAwC;AAAA;AAAA;AAM9C,wCAEE;AACA,QAAM,kBAAkB,MAAM;AAC9B,QAAM,kBAAkB,CAAC,QAAwB;AAC/C,gBAAY;AAEZ,UAAM,MAAM,iBAAiB;AAC7B,UAAM,0BAA0B,KAAK,MAAM,qBAAqB,OAAO;AAGvE,QAAI,MAAM,yBAAyB;AACjC,aAAO,MAAM;AAAA,WACR;AAKL,aAAO,gBAAgB;AAAA;AAAA;AAG3B,SAAO;AAAA;;;ACzDT,qCAA8E;AAC5E,QAAM,kBAAkB,MAAM;AAC9B,SAAO,CAAC,QAAqB,IAAI,gBAAgB,IAAI;AAAA;;;ACFvD,IAAM,yBAAyB;AAC/B,6BAAuC,MAA0B;AAC/D,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,UAAM,IAAK,OAAM,wBAAwB;AACzC,KAAC,KAAK,IAAI,KAAK,MAAM,CAAC,KAAK,IAAI,KAAK;AAAA;AAAA;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/cubing/vendor/comlink-everywhere/inside/node.js"],
4
- "sourcesContent": ["export async function port() {\n const { parentPort } = await import(\"worker_threads\").catch();\n const nodeEndpoint = (await import(\"comlink/dist/esm/node-adapter.mjs\"))\n .default;\n return nodeEndpoint(parentPort);\n}\n"],
5
- "mappings": ";;;AAAA,sBAA6B;AAC3B,QAAM,EAAE,eAAe,MAAM,OAAO,kBAAkB;AACtD,QAAM,eAAgB,OAAM,OAAO,sCAChC;AACH,SAAO,aAAa;AAAA;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/cubing/vendor/comlink-everywhere/outside/node.js"],
4
- "sourcesContent": ["async function getImports() {\n return {\n NodeWorker: (await import(\"worker_threads\")).Worker,\n nodeEndpoint: (await import(\"comlink/dist/esm/node-adapter.mjs\")).default,\n };\n}\n\nfunction construct(imports, url, nodeOptions) {\n const worker = new imports.NodeWorker(url, nodeOptions);\n // Avoid holding up the entire program exit if only workers are running.\n // https://nodejs.org/api/worker_threads.html#worker_threads_broadcastchannel_unref\n worker.unref();\n const wrappedWorker = imports.nodeEndpoint(worker);\n wrappedWorker.nodeWorker = worker; // TODO\n return wrappedWorker;\n}\n\nlet cachedNodeWorkerWrapper = null;\nexport async function NodeWorkerWrapper() {\n const imports = await getImports();\n return (\n cachedNodeWorkerWrapper ||\n (cachedNodeWorkerWrapper = class {\n constructor(url, _options) {\n return construct(imports, url);\n }\n })\n );\n}\n\nlet cachedNodeWorkerStringWrapper = null;\nexport async function NodeWorkerStringWrapper() {\n const imports = await getImports();\n return (\n cachedNodeWorkerStringWrapper ||\n (cachedNodeWorkerStringWrapper = class {\n constructor(url, _options) {\n return construct(imports, url, { eval: true });\n }\n })\n );\n}\n"],
5
- "mappings": ";;;AAAA,4BAA4B;AAC1B,SAAO;AAAA,IACL,YAAa,OAAM,OAAO,mBAAmB;AAAA,IAC7C,cAAe,OAAM,OAAO,sCAAsC;AAAA;AAAA;AAItE,mBAAmB,SAAS,KAAK,aAAa;AAC5C,QAAM,SAAS,IAAI,QAAQ,WAAW,KAAK;AAG3C,SAAO;AACP,QAAM,gBAAgB,QAAQ,aAAa;AAC3C,gBAAc,aAAa;AAC3B,SAAO;AAAA;AAGT,IAAI,0BAA0B;AAC9B,mCAA0C;AACxC,QAAM,UAAU,MAAM;AACtB,SACE,2BACC,2BAA0B,MAAM;AAAA,IAC/B,YAAY,KAAK,UAAU;AACzB,aAAO,UAAU,SAAS;AAAA;AAAA;AAAA;AAMlC,IAAI,gCAAgC;AACpC,yCAAgD;AAC9C,QAAM,UAAU,MAAM;AACtB,SACE,iCACC,iCAAgC,MAAM;AAAA,IACrC,YAAY,KAAK,UAAU;AACzB,aAAO,UAAU,SAAS,KAAK,EAAE,MAAM;AAAA;AAAA;AAAA;",
6
- "names": []
7
- }