cubing 0.22.0 → 0.22.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 (171) hide show
  1. package/README.md +4 -7
  2. package/dist/.DS_Store +0 -0
  3. package/dist/bin/order.js +16675 -0
  4. package/dist/bin/order.js.map +7 -0
  5. package/dist/bin/puzzle-geometry-bin.js +4 -4
  6. package/dist/bin/puzzle-geometry-bin.js.map +2 -2
  7. package/dist/bundle-global/cubing.bundle-global.js +469 -193
  8. package/dist/esm/{3d-3WQVOHX5.js → 3d-M7GBIT3X.js} +3 -3
  9. package/dist/esm/{3d-3WQVOHX5.js.map → 3d-M7GBIT3X.js.map} +0 -0
  10. package/dist/esm/bluetooth/index.js +8 -6
  11. package/dist/esm/bluetooth/index.js.map +3 -3
  12. package/dist/esm/{chunk-7KI3I3Y7.js → chunk-6BZSKSG7.js} +722 -733
  13. package/dist/esm/chunk-6BZSKSG7.js.map +7 -0
  14. package/dist/esm/{chunk-DLN5QS4V.js → chunk-GF76PWEV.js} +4 -2
  15. package/dist/esm/chunk-GF76PWEV.js.map +7 -0
  16. package/dist/esm/{chunk-HXKINJ7U.js → chunk-R3HRHYIW.js} +14 -2
  17. package/dist/esm/chunk-R3HRHYIW.js.map +7 -0
  18. package/dist/esm/esm-test-worker.js +2 -2
  19. package/dist/esm/esm-test-worker.js.map +2 -2
  20. package/dist/esm/{node-WEHVBEKP.js → node-HFBX5WHK.js} +2 -2
  21. package/dist/esm/{node-WEHVBEKP.js.map → node-HFBX5WHK.js.map} +1 -1
  22. package/dist/esm/{node-BSAQKO3G.js → node-SP4L2AKI.js} +2 -2
  23. package/dist/esm/{node-BSAQKO3G.js.map → node-SP4L2AKI.js.map} +1 -1
  24. package/dist/esm/puzzle-geometry/index.js +4 -4
  25. package/dist/esm/puzzle-geometry/index.js.map +2 -2
  26. package/dist/esm/puzzles/index.js +1 -1
  27. package/dist/esm/scramble/index.js +2 -2
  28. package/dist/esm/search/index.js +2 -2
  29. package/dist/esm/twisty/index.js +11 -7
  30. package/dist/esm/twisty/index.js.map +2 -2
  31. package/dist/esm/worker-inside-generated-string-RQYYANYQ.js +3107 -0
  32. package/dist/esm/worker-inside-generated-string-RQYYANYQ.js.map +7 -0
  33. package/dist/types/bluetooth/smart-puzzle/gan.d.ts.map +1 -1
  34. package/dist/types/cubing.bundle-global.exports.d.ts +25 -0
  35. package/dist/types/cubing.bundle-global.exports.d.ts.map +1 -0
  36. package/dist/types/puzzle-geometry/PuzzleGeometry.d.ts +2 -2
  37. package/dist/types/puzzle-geometry/PuzzleGeometry.d.ts.map +1 -1
  38. package/dist/types/puzzle-geometry/index.d.ts +1 -1
  39. package/dist/types/puzzle-geometry/index.d.ts.map +1 -1
  40. package/dist/types/puzzles/stickerings/cube-stickerings.d.ts.map +1 -1
  41. package/dist/types/search/inside/api.d.ts.map +1 -1
  42. package/dist/types/search/inside/solve/puzzles/4x4x4.d.ts +1 -1
  43. package/dist/types/search/inside/solve/puzzles/4x4x4.d.ts.map +1 -1
  44. package/dist/types/search/inside/solve/puzzles/fto.d.ts +6 -0
  45. package/dist/types/search/inside/solve/puzzles/fto.d.ts.map +1 -0
  46. package/dist/types/search/inside/solve/puzzles/fto.sgs.json.d.ts +5 -0
  47. package/dist/types/search/inside/solve/puzzles/fto.sgs.json.d.ts.map +1 -0
  48. package/dist/types/search/inside/solve/tremble.d.ts.map +1 -1
  49. package/dist/types/search/worker-inside-generated-string.d.ts +1 -1
  50. package/dist/types/search/worker-inside-generated-string.d.ts.map +1 -1
  51. package/dist/types/twisty/model/TwistyPlayerModel.d.ts.map +1 -1
  52. package/dist/types/twisty/model/props/puzzle/display/StickeringProp.d.ts +2 -0
  53. package/dist/types/twisty/model/props/puzzle/display/StickeringProp.d.ts.map +1 -1
  54. package/dist/types/twisty/model/props/puzzle/state/MovePressInputProp.d.ts +6 -1
  55. package/dist/types/twisty/model/props/puzzle/state/MovePressInputProp.d.ts.map +1 -1
  56. package/dist/types/{search/vendor → vendor}/comlink-everywhere/inside/index.d.ts +0 -0
  57. package/dist/types/vendor/comlink-everywhere/inside/index.d.ts.map +1 -0
  58. package/dist/types/{search/vendor → vendor}/comlink-everywhere/inside/node.d.ts +0 -0
  59. package/dist/types/vendor/comlink-everywhere/inside/node.d.ts.map +1 -0
  60. package/dist/types/{search/vendor → vendor}/comlink-everywhere/outside/index.d.ts +0 -0
  61. package/dist/types/vendor/comlink-everywhere/outside/index.d.ts.map +1 -0
  62. package/dist/types/{search/vendor → vendor}/comlink-everywhere/outside/node.d.ts +0 -0
  63. package/dist/types/vendor/comlink-everywhere/outside/node.d.ts.map +1 -0
  64. package/dist/types/{search/inside/solve/vendor → vendor}/cstimer/src/js/lib/mathlib.d.ts +0 -0
  65. package/dist/types/vendor/cstimer/src/js/lib/mathlib.d.ts.map +1 -0
  66. package/dist/types/{search/inside/solve/vendor → vendor}/cstimer/src/js/scramble/scramble_444.d.ts +1 -1
  67. package/dist/types/vendor/cstimer/src/js/scramble/scramble_444.d.ts.map +1 -0
  68. package/dist/types/{search/inside/solve/vendor → vendor}/min2phase/gwt.d.ts +0 -0
  69. package/dist/types/vendor/min2phase/gwt.d.ts.map +1 -0
  70. package/dist/types/{search/inside/solve/vendor → vendor}/random-uint-below/get-random-values.d.ts +0 -0
  71. package/dist/types/vendor/random-uint-below/get-random-values.d.ts.map +1 -0
  72. package/dist/types/{search/inside/solve/vendor → vendor}/random-uint-below/index.d.ts +1 -1
  73. package/dist/types/vendor/random-uint-below/index.d.ts.map +1 -0
  74. package/dist/types/{search/inside/solve/vendor → vendor}/random-uint-below/random-choice.d.ts +0 -0
  75. package/dist/types/vendor/random-uint-below/random-choice.d.ts.map +1 -0
  76. package/dist/types/{search/inside/solve/vendor/random-uint-below/random-int.d.ts → vendor/random-uint-below/random53BitValue.d.ts} +1 -1
  77. package/dist/types/vendor/random-uint-below/random53BitValue.d.ts.map +1 -0
  78. package/dist/types/{search/inside/solve/vendor → vendor}/sq12phase/scramble_sq1.d.ts +0 -0
  79. package/dist/types/vendor/sq12phase/scramble_sq1.d.ts.map +1 -0
  80. package/dist/types/{bluetooth/smart-puzzle → vendor/unsafe-raw-aes}/unsafe-raw-aes.d.ts +0 -0
  81. package/dist/types/vendor/unsafe-raw-aes/unsafe-raw-aes.d.ts.map +1 -0
  82. package/docs/.DS_Store +0 -0
  83. package/docs/cubing/.DS_Store +0 -0
  84. package/docs/cubing/index.html +67 -27
  85. package/docs/main.css +7 -6
  86. package/package.json +8 -9
  87. package/src/cubing/.DS_Store +0 -0
  88. package/src/cubing/bluetooth/smart-puzzle/gan.ts +4 -1
  89. package/src/cubing/cubing.bundle-global.exports.ts +25 -0
  90. package/src/cubing/cubing.bundle-global.ts +2 -26
  91. package/src/cubing/puzzle-geometry/PuzzleGeometry.ts +6 -2
  92. package/src/cubing/puzzle-geometry/index.ts +2 -2
  93. package/src/cubing/puzzles/.DS_Store +0 -0
  94. package/{dist/esm → src/cubing/puzzles/implementations}/.DS_Store +0 -0
  95. package/src/cubing/puzzles/stickerings/cube-stickerings.ts +18 -0
  96. package/src/cubing/puzzles/stickerings/global-custom-stickering-hack.ts +1 -1
  97. package/src/cubing/search/.DS_Store +0 -0
  98. package/src/cubing/search/esm-test-worker.js +1 -1
  99. package/src/cubing/search/inside/.DS_Store +0 -0
  100. package/src/cubing/search/inside/api.ts +3 -0
  101. package/src/cubing/search/inside/entry.js +1 -1
  102. package/src/cubing/search/inside/inside-worker.ts +1 -1
  103. package/src/cubing/search/inside/solve/.DS_Store +0 -0
  104. package/src/cubing/search/inside/solve/addOrientationSuffix.ts +1 -1
  105. package/src/cubing/search/inside/solve/puzzles/.DS_Store +0 -0
  106. package/src/cubing/search/inside/solve/puzzles/2x2x2.ts +1 -1
  107. package/src/cubing/search/inside/solve/puzzles/3x3x3/index.ts +2 -2
  108. package/src/cubing/search/inside/solve/puzzles/4x4x4.ts +2 -2
  109. package/src/cubing/search/inside/solve/puzzles/big-cubes.ts +1 -1
  110. package/src/cubing/search/inside/solve/puzzles/clock.ts +1 -1
  111. package/src/cubing/search/inside/solve/puzzles/{FTO.sgs → fto.sgs.json.ts} +116 -80
  112. package/src/cubing/search/inside/solve/puzzles/fto.ts +58 -0
  113. package/src/cubing/search/inside/solve/puzzles/sq1.ts +1 -1
  114. package/src/cubing/search/inside/solve/puzzles/wca-minx.ts +1 -1
  115. package/src/cubing/search/inside/solve/tremble.ts +2 -1
  116. package/src/cubing/search/inside/solve/vendor/.DS_Store +0 -0
  117. package/src/cubing/search/instantiator.ts +1 -1
  118. package/src/cubing/search/worker-inside-generated-string.js +1 -1
  119. package/src/cubing/twisty/.DS_Store +0 -0
  120. package/src/cubing/twisty/controllers/.DS_Store +0 -0
  121. package/src/cubing/twisty/heavy-code-imports/.DS_Store +0 -0
  122. package/src/cubing/twisty/model/.DS_Store +0 -0
  123. package/src/cubing/twisty/model/TwistyPlayerModel.ts +8 -6
  124. package/src/cubing/twisty/model/props/.DS_Store +0 -0
  125. package/src/cubing/twisty/model/props/puzzle/.DS_Store +0 -0
  126. package/src/cubing/twisty/model/props/puzzle/display/StickeringProp.ts +2 -0
  127. package/src/cubing/twisty/model/props/puzzle/state/MovePressInputProp.ts +6 -1
  128. package/src/cubing/twisty/old/.DS_Store +0 -0
  129. package/src/cubing/twisty/views/.DS_Store +0 -0
  130. package/src/cubing/twisty/views/3D/.DS_Store +0 -0
  131. package/src/cubing/twisty/views/node-custom-element-shims.ts +2 -2
  132. package/src/cubing/vendor/.DS_Store +0 -0
  133. package/src/cubing/vendor/comlink-everywhere/.DS_Store +0 -0
  134. package/src/cubing/{search/vendor → vendor}/comlink-everywhere/comlink-everywhere.webloc +0 -0
  135. package/src/cubing/{search/vendor → vendor}/comlink-everywhere/inside/index.d.ts +0 -0
  136. package/src/cubing/{search/vendor → vendor}/comlink-everywhere/inside/index.js +0 -0
  137. package/src/cubing/{search/vendor → vendor}/comlink-everywhere/inside/node.js +0 -0
  138. package/src/cubing/{search/vendor → vendor}/comlink-everywhere/outside/index.d.ts +0 -0
  139. package/src/cubing/{search/vendor → vendor}/comlink-everywhere/outside/index.js +0 -0
  140. package/src/cubing/{search/vendor → vendor}/comlink-everywhere/outside/node.js +0 -0
  141. package/src/cubing/vendor/cstimer/.DS_Store +0 -0
  142. package/src/cubing/{search/inside/solve/vendor → vendor}/cstimer/LICENSE +0 -0
  143. package/src/cubing/{search/inside/solve/vendor → vendor}/cstimer/src/js/lib/mathlib.ts +0 -0
  144. package/src/cubing/{search/inside/solve/vendor → vendor}/cstimer/src/js/scramble/scramble_444.ts +3 -3
  145. package/src/cubing/{search/inside/solve/vendor → vendor}/min2phase/gwt.d.ts +0 -0
  146. package/src/cubing/{search/inside/solve/vendor → vendor}/min2phase/gwt.js +0 -0
  147. package/src/cubing/vendor/random-uint-below/get-random-values.ts +23 -0
  148. package/src/cubing/{search/inside/solve/vendor → vendor}/random-uint-below/index.ts +2 -2
  149. package/src/cubing/{search/inside/solve/vendor → vendor}/random-uint-below/random-choice.ts +1 -1
  150. package/src/cubing/{search/inside/solve/vendor/random-uint-below/random-int.ts → vendor/random-uint-below/random53BitValue.ts} +0 -0
  151. package/src/cubing/{search/inside/solve/vendor → vendor}/sq12phase/scramble_sq1.js +0 -0
  152. package/src/cubing/{bluetooth/smart-puzzle → vendor/unsafe-raw-aes}/unsafe-raw-aes.ts +18 -20
  153. package/dist/esm/chunk-7KI3I3Y7.js.map +0 -7
  154. package/dist/esm/chunk-DLN5QS4V.js.map +0 -7
  155. package/dist/esm/chunk-HXKINJ7U.js.map +0 -7
  156. package/dist/esm/worker-inside-generated-string-ZA6E6672.js +0 -2831
  157. package/dist/esm/worker-inside-generated-string-ZA6E6672.js.map +0 -7
  158. package/dist/types/bluetooth/smart-puzzle/unsafe-raw-aes.d.ts.map +0 -1
  159. package/dist/types/search/inside/solve/vendor/cstimer/src/js/lib/mathlib.d.ts.map +0 -1
  160. package/dist/types/search/inside/solve/vendor/cstimer/src/js/scramble/scramble_444.d.ts.map +0 -1
  161. package/dist/types/search/inside/solve/vendor/min2phase/gwt.d.ts.map +0 -1
  162. package/dist/types/search/inside/solve/vendor/random-uint-below/get-random-values.d.ts.map +0 -1
  163. package/dist/types/search/inside/solve/vendor/random-uint-below/index.d.ts.map +0 -1
  164. package/dist/types/search/inside/solve/vendor/random-uint-below/random-choice.d.ts.map +0 -1
  165. package/dist/types/search/inside/solve/vendor/random-uint-below/random-int.d.ts.map +0 -1
  166. package/dist/types/search/inside/solve/vendor/sq12phase/scramble_sq1.d.ts.map +0 -1
  167. package/dist/types/search/vendor/comlink-everywhere/inside/index.d.ts.map +0 -1
  168. package/dist/types/search/vendor/comlink-everywhere/inside/node.d.ts.map +0 -1
  169. package/dist/types/search/vendor/comlink-everywhere/outside/index.d.ts.map +0 -1
  170. package/dist/types/search/vendor/comlink-everywhere/outside/node.d.ts.map +0 -1
  171. package/src/cubing/search/inside/solve/vendor/random-uint-below/get-random-values.ts +0 -38
@@ -1,5 +1,5 @@
1
1
  import { Alg, AlgBuilder, Move } from "../../../alg";
2
- import { randomChoiceFactory } from "./vendor/random-uint-below";
2
+ import { randomChoiceFactory } from "../../../vendor/random-uint-below";
3
3
 
4
4
  export async function addOrientationSuffix(
5
5
  alg: Alg,
@@ -9,7 +9,7 @@ import { mustBeInsideWorker } from "../../inside-worker";
9
9
  import {
10
10
  randomPermute,
11
11
  randomUIntBelowFactory,
12
- } from "../vendor/random-uint-below";
12
+ } from "../../../../vendor/random-uint-below";
13
13
  import type { SGSCachedData } from "../parseSGS";
14
14
  import { TrembleSolver } from "../tremble";
15
15
 
@@ -3,11 +3,11 @@ import { KPuzzle, Transformation } from "../../../../../kpuzzle";
3
3
  import { puzzles } from "../../../../../puzzles";
4
4
  import { mustBeInsideWorker } from "../../../inside-worker";
5
5
  import { addOrientationSuffix } from "../../addOrientationSuffix";
6
- import { initialize, solveState } from "../../vendor/min2phase/gwt";
7
- import { randomChoiceFactory } from "../../vendor/random-uint-below";
6
+ import { randomChoiceFactory } from "../../../../../vendor/random-uint-below";
8
7
  import { toMin2PhaseState } from "./convert";
9
8
  import { passesFilter } from "./filter";
10
9
  import { sgs3x3x3 } from "./legacy-sgs";
10
+ import { initialize, solveState } from "../../../../../vendor/min2phase/gwt";
11
11
 
12
12
  export async function random333State(): Promise<Transformation> {
13
13
  const def = await puzzles["3x3x3"].def();
@@ -1,10 +1,10 @@
1
1
  import type { Alg } from "../../../../alg";
2
2
  import { addOrientationSuffix } from "../addOrientationSuffix";
3
- import { random444Scramble } from "../vendor/cstimer/src/js/scramble/scramble_444";
3
+ import { random444Scramble } from "../../../../vendor/cstimer/src/js/scramble/scramble_444";
4
4
  export {
5
5
  initialize as initialize444,
6
6
  random444Scramble,
7
- } from "../vendor/cstimer/src/js/scramble/scramble_444";
7
+ } from "../../../../vendor/cstimer/src/js/scramble/scramble_444";
8
8
 
9
9
  const randomSuffixes = [
10
10
  [null, "x", "x2", "x'", "z", "z'"],
@@ -2,7 +2,7 @@ import { Alg, AlgBuilder, Move, QuantumMove } from "../../../../alg";
2
2
  import {
3
3
  randomChoiceFactory,
4
4
  randomUIntBelowFactory,
5
- } from "../vendor/random-uint-below";
5
+ } from "../../../../vendor/random-uint-below";
6
6
 
7
7
  function numMoves(n: number): number {
8
8
  switch (n) {
@@ -1,4 +1,4 @@
1
- import { randomUIntBelowFactory } from "../vendor/random-uint-below";
1
+ import { randomUIntBelowFactory } from "../../../../vendor/random-uint-below";
2
2
 
3
3
  const pins = ["UR", "DR", "DL", "UL"];
4
4
  const backMoves = ["U", "R", "D", "L", "ALL"];
@@ -1,16 +1,49 @@
1
- SubgroupSizes 12 12 11 12 12 11 10 9 11 8 10 9 7 8 10 10 6 9 8 5 7 6 5 4 4 8 7 3 6 6 2 5 3 4 3
2
-
3
- Alg BB
4
- Alg BB'
1
+ import type { KPuzzleDefinition } from "../../../../kpuzzle";
2
+ import { getPuzzleGeometryByName } from "../../../../puzzle-geometry";
3
+ import { parseSGS, SGSCachedData } from "../parseSGS";
4
+
5
+ export async function ftoDef(): Promise<KPuzzleDefinition> {
6
+ return getPuzzleGeometryByName("FTO", {
7
+ allMoves: true,
8
+ orientCenters: true,
9
+ addRotations: true,
10
+ }).writekpuzzle(true);
11
+ }
12
+
13
+ let cachedData: Promise<SGSCachedData> | null = null;
14
+ export async function sgsDataFTO() {
15
+ return (cachedData ??= uncachedSGSDataFTO());
16
+ }
17
+
18
+ // TODO: Reduce info.
19
+ async function uncachedSGSDataFTO(): Promise<SGSCachedData> {
20
+ return parseSGS(
21
+ await ftoDef(),
22
+ `SubgroupSizes 24 12 11 12 12 11 10 9 11 8 10 9 7 8 10 10 6 9 8 5 7 6 5 4 4 8 7 3 6 6 2 5 3 4 3
23
+
24
+ Alg T
25
+ Alg B
26
+ Alg B T
27
+ Alg B'
28
+ Alg B' T
5
29
  Alg U
30
+ Alg U T
6
31
  Alg U'
7
- Alg BB BL
8
- Alg BB BL'
9
- Alg BB' BR
10
- Alg BB' BR'
32
+ Alg U' T
33
+ Alg B BL
34
+ Alg B BL T
35
+ Alg B BL'
36
+ Alg B BL' T
37
+ Alg B' BR
38
+ Alg B' BR T
39
+ Alg B' BR'
40
+ Alg B' BR' T
11
41
  Alg U R'
42
+ Alg U R' T
12
43
  Alg U' L
13
- Alg BB BL' D
44
+ Alg U' L T
45
+ Alg B BL' D
46
+ Alg B BL' D T
14
47
 
15
48
  Alg R
16
49
  Alg R'
@@ -21,19 +54,19 @@ Alg R BR'
21
54
  Alg R' F
22
55
  Alg R' L
23
56
  Alg R' L'
24
- Alg BB L BB'
57
+ Alg B L B'
25
58
  Alg U L' U'
26
59
 
27
- Alg BB U BB'
28
- Alg BB U' BB'
29
- Alg BB R BB'
30
- Alg BB R' BB'
31
- Alg BB' U' BB
32
- Alg BB' U BB L
33
- Alg BB' U BB L'
34
- Alg BB' U' BB BL'
35
- Alg BB U' BB' BR
36
- Alg BB' R' BB F
60
+ Alg B U B'
61
+ Alg B U' B'
62
+ Alg B R B'
63
+ Alg B R' B'
64
+ Alg B' U' B
65
+ Alg B' U B L
66
+ Alg B' U B L'
67
+ Alg B' U' B BL'
68
+ Alg B U' B' BR
69
+ Alg B' R' B F
37
70
 
38
71
  Alg BR
39
72
  Alg BR'
@@ -42,22 +75,22 @@ Alg BR BL'
42
75
  Alg BR' F
43
76
  Alg BR' F'
44
77
  Alg BR' D
45
- Alg BB BR BB'
78
+ Alg B BR B'
46
79
  Alg U F U'
47
80
  Alg BR BL L
48
81
  Alg BR' D BR'
49
82
 
50
- Alg BB' BL BB
51
- Alg BB' BL' BB
83
+ Alg B' BL B
84
+ Alg B' BL' B
52
85
  Alg BR D' BR'
53
- Alg BB' BL BB D'
54
- Alg BB' BL BB BL
55
- Alg BB' BL BB BL'
56
- Alg BB' BL L BB
57
- Alg BB' BL' BB F'
58
- Alg BB' BL' BB L'
59
- Alg BB' BL' BB BL'
60
- Alg BB' BL' L BL' BB
86
+ Alg B' BL B D'
87
+ Alg B' BL B BL
88
+ Alg B' BL B BL'
89
+ Alg B' BL L B
90
+ Alg B' BL' B F'
91
+ Alg B' BL' B L'
92
+ Alg B' BL' B BL'
93
+ Alg B' BL' L BL' B
61
94
 
62
95
  Alg R' BR R
63
96
  Alg R' BR' R
@@ -65,8 +98,8 @@ Alg BR BL' D BR
65
98
  Alg R' BR D R
66
99
  Alg R' BR D' R
67
100
  Alg R' BR R BL
68
- Alg BB' D' BL D BB
69
- Alg BR BB D' BB' BR'
101
+ Alg B' D' BL D B
102
+ Alg BR B D' B' BR'
70
103
  Alg BR BL' D BR L'
71
104
  Alg BR BL' D BL BR
72
105
 
@@ -74,31 +107,31 @@ Alg U BR U'
74
107
  Alg U BR' U'
75
108
  Alg U' R U
76
109
  Alg U' R' U
77
- Alg U BR BB' U'
110
+ Alg U BR B' U'
78
111
  Alg U BR' U' D
79
112
  Alg U BR' U' D'
80
113
  Alg U' R F' U
81
114
  Alg U' R' U L'
82
115
 
83
- Alg U BB U'
84
- Alg U BB' U'
85
- Alg U BB U' L
86
- Alg U BB U' L'
87
- Alg U BB' U' BL'
88
- Alg U BB U' L F
89
- Alg U BB U' L F'
90
- Alg U BB' U' BL' D'
91
-
92
- Alg BB BL' L BL BB'
93
- Alg BB BL' L' BL BB'
94
- Alg U BB' D BB U'
95
- Alg U BB' D' BB U'
116
+ Alg U B U'
117
+ Alg U B' U'
118
+ Alg U B U' L
119
+ Alg U B U' L'
120
+ Alg U B' U' BL'
121
+ Alg U B U' L F
122
+ Alg U B U' L F'
123
+ Alg U B' U' BL' D'
124
+
125
+ Alg B BL' L BL B'
126
+ Alg B BL' L' BL B'
127
+ Alg U B' D B U'
128
+ Alg U B' D' B U'
96
129
  Alg U R D R' U'
97
130
  Alg U R D' R' U'
98
131
  Alg R' F L F' R
99
132
  Alg R' F L' F' R
100
- Alg BB L' BB F' D BB
101
- Alg U BB' D' BB U' D
133
+ Alg B L' B F' D B
134
+ Alg U B' D' B U' D
102
135
 
103
136
  Alg F
104
137
  Alg F'
@@ -148,19 +181,19 @@ Alg R' D R
148
181
  Alg R' D' R
149
182
  Alg L D L' D'
150
183
  Alg L R L' R'
151
- Alg L' BB' L BB
184
+ Alg L' B' L B
152
185
  Alg R' D R BL
153
186
  Alg L BL' L' BL L'
154
187
 
155
188
  Alg U L' D L U'
156
- Alg U BB D BB' U'
189
+ Alg U B D B' U'
157
190
  Alg U L' D' L U'
158
- Alg U BB D' BB' U'
191
+ Alg U B D' B' U'
159
192
  Alg R' D' BL' D R
160
- Alg U BB D' BB' U' D
161
- Alg U BB' L BB L' U'
162
- Alg U BB D BB' U' BL'
163
- Alg U BB D' BB' L' D' L U'
193
+ Alg U B D' B' U' D
194
+ Alg U B' L B L' U'
195
+ Alg U B D B' U' BL'
196
+ Alg U B D' B' L' D' L U'
164
197
 
165
198
  Alg F L F'
166
199
  Alg F L' F'
@@ -172,18 +205,18 @@ Alg L BL' D BL L'
172
205
  Alg L BL' D' BL L'
173
206
  Alg F D L D' L' F'
174
207
  Alg F L D L' D' F'
175
- Alg F L' BB' L BB F'
208
+ Alg F L' B' L B F'
176
209
  Alg F' D' R' D R F
177
210
  Alg F D L D' L' F' BL'
178
- Alg F' R' BB' R' BB R' F
211
+ Alg F' R' B' R' B R' F
179
212
 
180
- Alg BB D BB'
181
- Alg BB D' BB'
213
+ Alg B D B'
214
+ Alg B D' B'
182
215
  Alg L' D L
183
216
  Alg L' D' L
184
- Alg BB D BB' D'
185
- Alg BB' L BB L'
186
- Alg BB D BB' D' BL
217
+ Alg B D B' D'
218
+ Alg B' L B L'
219
+ Alg B D B' D' BL
187
220
 
188
221
  Alg D
189
222
  Alg D'
@@ -192,14 +225,14 @@ Alg D BL'
192
225
 
193
226
  Alg D BL' D BL D'
194
227
  Alg D BL' D' BL D'
195
- Alg BB D R D' R' BB'
196
- Alg BB R D R' D' BB'
228
+ Alg B D R D' R' B'
229
+ Alg B R D R' D' B'
197
230
  Alg D BL' D BL D' BL
198
231
  Alg D BL' D BL D' BL'
199
232
 
200
233
  Alg D BL D BL' D'
201
234
  Alg D BL D' BL' D'
202
- Alg BB' BL' BB BR D' BR'
235
+ Alg B' BL' B BR D' BR'
203
236
  Alg D BL D BL' D' BL
204
237
  Alg D BL D BL' D' BL'
205
238
 
@@ -208,15 +241,15 @@ Alg D' BL' D
208
241
  Alg D' BL D BL
209
242
  Alg D' BL D BL'
210
243
 
211
- Alg BB D' BB' BL BB D BB'
212
- Alg BB D' BB' BL' BB D BB'
244
+ Alg B D' B' BL B D B'
245
+ Alg B D' B' BL' B D B'
213
246
  Alg D' BL' D BL D' BL D
214
247
 
215
- Alg BB R' BB' BL BB R BB'
216
- Alg BB R' BB' BL' BB R BB'
248
+ Alg B R' B' BL B R B'
249
+ Alg B R' B' BL' B R B'
217
250
  Alg L R L' BL' L R' L'
218
251
 
219
- Alg F BL' BB' BL F' BL' BB
252
+ Alg F BL' B' BL F' BL' B
220
253
  Alg F' R' F BL F' R F
221
254
  Alg F' R' F BL' F' R F
222
255
  Alg BR R BR' BL' BR R' BR'
@@ -241,7 +274,7 @@ Alg BR F BL F' BL' BR'
241
274
  Alg F U' F' U BL' U BL U'
242
275
 
243
276
  Alg F U' F' D F U F' D'
244
- Alg BB' U' F U BB U' F' U
277
+ Alg B' U' F U B U' F' U
245
278
  Alg D F U' F' D' F U F'
246
279
  Alg BR' U BR D' BR' U' BR D
247
280
  Alg D' BR BL' F BL' F' BL BR' BL D
@@ -250,15 +283,18 @@ Alg U BR' U' BR BL' BR BL BR'
250
283
 
251
284
  Alg F L F' BL D F' D' F BL' L'
252
285
  Alg F' BR F BR' L BL' BR' BL BR L'
253
- Alg BB BR' U R BR' R' BR U' BB' BR
286
+ Alg B BR' U R BR' R' BR U' B' BR
254
287
  Alg U BR' U' BR L' BL BR BL' BR' L
255
288
 
256
- Alg F BL F' BL F BL F' BL
257
- Alg F BL' F' BL' F BL' F' BL'
289
+ Alg B' F' BR' L R' BL U R BL' BR L' B' F BL' B'
290
+ Alg B BL F' B L BR' BL R' U' BL' R L' BR F B
258
291
 
259
292
  Alg F' D BR F' R F R' BR' F D'
260
- Alg BB BL U' L U L' BL' U BB' U'
261
- Alg U BB U' BL L U' L' U BL' BB'
262
-
263
- Alg F BL F' BL' BB F' BR F BR' BB'
264
- Alg BB BR F' BR' BB' F BL F BL' F'
293
+ Alg B BL U' L U L' BL' U B' U'
294
+ Alg U B U' BL L U' L' U BL' B'
295
+
296
+ Alg F BL F' BL' B F' BR F BR' B'
297
+ Alg B BR F' BR' B' F BL F BL' F'
298
+ `,
299
+ );
300
+ }
@@ -0,0 +1,58 @@
1
+ import type { Alg } from "../../../../alg";
2
+ import type { Transformation } from "../../../../kpuzzle";
3
+ import { mustBeInsideWorker } from "../../inside-worker";
4
+ import type { SGSCachedData } from "../parseSGS";
5
+ import { randomStateFromSGS, TrembleSolver } from "../tremble";
6
+
7
+ const TREMBLE_DEPTH = 3;
8
+
9
+ let cachedTrembleSolver: Promise<TrembleSolver> | null = null;
10
+ async function getCachedTrembleSolver(): Promise<TrembleSolver> {
11
+ return (
12
+ cachedTrembleSolver ||
13
+ (cachedTrembleSolver = (async (): Promise<TrembleSolver> => {
14
+ const sgs = await import("./fto.sgs.json");
15
+ const json: SGSCachedData = await sgs.sgsDataFTO();
16
+ return new TrembleSolver(await sgs.ftoDef(), json, [
17
+ "U",
18
+ "R",
19
+ "F",
20
+ "L",
21
+ "D",
22
+ "B",
23
+ "BR",
24
+ "BL",
25
+ ]);
26
+ })())
27
+ );
28
+ }
29
+
30
+ export async function preInitializeFTO(): Promise<void> {
31
+ await getCachedTrembleSolver();
32
+ }
33
+
34
+ // TODO: centers
35
+ export async function solveFTO(state: Transformation): Promise<Alg> {
36
+ mustBeInsideWorker();
37
+ const trembleSolver = await getCachedTrembleSolver();
38
+ const alg = await trembleSolver.solve(
39
+ state,
40
+ TREMBLE_DEPTH,
41
+ () => 3, // TODO: Attach quantum move order lookup to puzzle.
42
+ );
43
+ return alg;
44
+ }
45
+
46
+ let warned = false;
47
+ export async function randomFTOScramble(): Promise<Alg> {
48
+ if (!warned) {
49
+ console.warn(
50
+ "FTO scrambles are not yet optimized. They may be much too long (≈90 moves).",
51
+ );
52
+ warned = true;
53
+ }
54
+ const sgs = await import("./fto.sgs.json");
55
+ return solveFTO(
56
+ await randomStateFromSGS(await sgs.ftoDef(), await sgs.sgsDataFTO()),
57
+ );
58
+ }
@@ -1,5 +1,5 @@
1
1
  import { Alg } from "../../../../alg";
2
- import { getRandomSquare1ScrambleString } from "../vendor/sq12phase/scramble_sq1";
2
+ import { getRandomSquare1ScrambleString } from "../../../../vendor/sq12phase/scramble_sq1";
3
3
 
4
4
  export async function getRandomSquare1Scramble(): Promise<Alg> {
5
5
  return Alg.fromString(await getRandomSquare1ScrambleString());
@@ -1,4 +1,4 @@
1
- import { randomUIntBelowFactory } from "../vendor/random-uint-below";
1
+ import { randomUIntBelowFactory } from "../../../../vendor/random-uint-below";
2
2
 
3
3
  const randomUIntBelowPromise = randomUIntBelowFactory();
4
4
 
@@ -10,7 +10,7 @@ import {
10
10
  } from "../../../kpuzzle";
11
11
  import { countMoves } from "../../../notation";
12
12
  import type { SGSAction, SGSCachedData } from "./parseSGS";
13
- import { randomChoiceFactory } from "./vendor/random-uint-below";
13
+ import { randomChoiceFactory } from "../../../vendor/random-uint-below";
14
14
 
15
15
  const DEFAULT_STAGE1_DEPTH_LIMIT = 2; // Moderately performant default.
16
16
 
@@ -170,6 +170,7 @@ export class TrembleSolver {
170
170
  const idx = loc.permutationIdx;
171
171
  key += ` ${inverseState[orbitName].permutation[idx]} ${inverseState[orbitName].orientation[idx]}`;
172
172
  }
173
+ // console.log(key, step.lookup);
173
174
  const info = step.lookup[key];
174
175
  if (!info) {
175
176
  throw new Error("Missing algorithm in sgs or esgs?");
@@ -4,7 +4,7 @@ import {
4
4
  constructWorkerFromString,
5
5
  workerFileConstructor,
6
6
  wrap,
7
- } from "./vendor/comlink-everywhere/outside";
7
+ } from "../vendor/comlink-everywhere/outside";
8
8
 
9
9
  import type { esmTestAPIImplementation } from "./esm-test-worker";
10
10
  type ESMTestAPI = typeof esmTestAPIImplementation;