@rednaxela101/cubing 0.63.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +120 -0
- package/alg/index.d.ts +1 -0
- package/bluetooth/index.d.ts +1 -0
- package/dist/bin/chunks/chunk-22VWCGBC.js +13 -0
- package/dist/bin/chunks/chunk-22VWCGBC.js.map +7 -0
- package/dist/bin/order.js +59 -0
- package/dist/bin/order.js.map +7 -0
- package/dist/bin/puzzle-geometry-bin.js +407 -0
- package/dist/bin/puzzle-geometry-bin.js.map +7 -0
- package/dist/bin/scramble.js +188 -0
- package/dist/bin/scramble.js.map +7 -0
- package/dist/bin/svg.js +56 -0
- package/dist/bin/svg.js.map +7 -0
- package/dist/lib/cubing/alg/index.d.ts +2 -0
- package/dist/lib/cubing/alg/index.js +43 -0
- package/dist/lib/cubing/alg/index.js.map +7 -0
- package/dist/lib/cubing/bluetooth/index.d.ts +189 -0
- package/dist/lib/cubing/bluetooth/index.js +2271 -0
- package/dist/lib/cubing/bluetooth/index.js.map +7 -0
- package/dist/lib/cubing/chunks/big-puzzle-orientation-BA6QHO5C.js +68 -0
- package/dist/lib/cubing/chunks/big-puzzle-orientation-BA6QHO5C.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-2VJB4TMH.js +1774 -0
- package/dist/lib/cubing/chunks/chunk-2VJB4TMH.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-52ZXJEUO.js +665 -0
- package/dist/lib/cubing/chunks/chunk-52ZXJEUO.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-56VZAEPF.js +274 -0
- package/dist/lib/cubing/chunks/chunk-56VZAEPF.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-7GUL3OBQ.js +9 -0
- package/dist/lib/cubing/chunks/chunk-7GUL3OBQ.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-7L7BJSIM.js +21 -0
- package/dist/lib/cubing/chunks/chunk-7L7BJSIM.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-AESPJKN6.js +265 -0
- package/dist/lib/cubing/chunks/chunk-AESPJKN6.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-C2Q347XS.js +89 -0
- package/dist/lib/cubing/chunks/chunk-C2Q347XS.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-CGBMJBU3.js +1195 -0
- package/dist/lib/cubing/chunks/chunk-CGBMJBU3.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-HZQONEMD.js +249 -0
- package/dist/lib/cubing/chunks/chunk-HZQONEMD.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-IAGCVPL3.js +1069 -0
- package/dist/lib/cubing/chunks/chunk-IAGCVPL3.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-NAPITA3L.js +1 -0
- package/dist/lib/cubing/chunks/chunk-NAPITA3L.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-XPDJUSZ7.js +1876 -0
- package/dist/lib/cubing/chunks/chunk-XPDJUSZ7.js.map +7 -0
- package/dist/lib/cubing/chunks/chunk-YSI6PF35.js +619 -0
- package/dist/lib/cubing/chunks/chunk-YSI6PF35.js.map +7 -0
- package/dist/lib/cubing/chunks/inside-LG2EAKCL.js +557 -0
- package/dist/lib/cubing/chunks/inside-LG2EAKCL.js.map +7 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-2x2x2-JYJJXB4V.js +142 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-2x2x2-JYJJXB4V.js.map +7 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-3x3x3-FYXD7SIU.js +365 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-3x3x3-FYXD7SIU.js.map +7 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-4x4x4-AIGABOAR.js +132 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-4x4x4-AIGABOAR.js.map +7 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-5x5x5-JUNRX27W.js +277 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-5x5x5-JUNRX27W.js.map +7 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-clock-USGQTDPO.js +836 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-clock-USGQTDPO.js.map +7 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-fto-WJHMLYCJ.js +100 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-fto-WJHMLYCJ.js.map +7 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-megaminx-2LVHIDL4.js +224 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-megaminx-2LVHIDL4.js.map +7 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-pyraminx-7UWX4HHI.js +93 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-pyraminx-7UWX4HHI.js.map +7 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-square1-PQEKBPFN.js +842 -0
- package/dist/lib/cubing/chunks/puzzles-dynamic-square1-PQEKBPFN.js.map +7 -0
- package/dist/lib/cubing/chunks/search-dynamic-sgs-2x2x2-XFKQ4VJS.js +125 -0
- package/dist/lib/cubing/chunks/search-dynamic-sgs-2x2x2-XFKQ4VJS.js.map +7 -0
- package/dist/lib/cubing/chunks/search-dynamic-sgs-megaminx-ZDOOLEDW.js +1564 -0
- package/dist/lib/cubing/chunks/search-dynamic-sgs-megaminx-ZDOOLEDW.js.map +7 -0
- package/dist/lib/cubing/chunks/search-dynamic-sgs-pyraminx-W6UJWBYY.js +108 -0
- package/dist/lib/cubing/chunks/search-dynamic-sgs-pyraminx-W6UJWBYY.js.map +7 -0
- package/dist/lib/cubing/chunks/search-dynamic-sgs-skewb-FXGKV4KD.js +125 -0
- package/dist/lib/cubing/chunks/search-dynamic-sgs-skewb-FXGKV4KD.js.map +7 -0
- package/dist/lib/cubing/chunks/search-dynamic-sgs-unofficial-YK6HA7BK.js +644 -0
- package/dist/lib/cubing/chunks/search-dynamic-sgs-unofficial-YK6HA7BK.js.map +7 -0
- package/dist/lib/cubing/chunks/search-dynamic-solve-3x3x3-DLMAGPXS.js +2549 -0
- package/dist/lib/cubing/chunks/search-dynamic-solve-3x3x3-DLMAGPXS.js.map +7 -0
- package/dist/lib/cubing/chunks/search-dynamic-solve-4x4x4-NONXQHOJ.js +2923 -0
- package/dist/lib/cubing/chunks/search-dynamic-solve-4x4x4-NONXQHOJ.js.map +7 -0
- package/dist/lib/cubing/chunks/search-dynamic-solve-fto-3GQ2HLSW.js +1405 -0
- package/dist/lib/cubing/chunks/search-dynamic-solve-fto-3GQ2HLSW.js.map +7 -0
- package/dist/lib/cubing/chunks/search-worker-entry.js +19 -0
- package/dist/lib/cubing/chunks/search-worker-entry.js.map +7 -0
- package/dist/lib/cubing/chunks/square1-stickerings-W2ZLZWIN.js +73 -0
- package/dist/lib/cubing/chunks/square1-stickerings-W2ZLZWIN.js.map +7 -0
- package/dist/lib/cubing/chunks/twips-2RNTWYNZ.js +433 -0
- package/dist/lib/cubing/chunks/twips-2RNTWYNZ.js.map +7 -0
- package/dist/lib/cubing/chunks/twips_wasm_bg-TJNYGA2C-23XTPLIK.js +10 -0
- package/dist/lib/cubing/chunks/twips_wasm_bg-TJNYGA2C-23XTPLIK.js.map +7 -0
- package/dist/lib/cubing/chunks/twisty-dynamic-3d-JO6OGKOF.js +2424 -0
- package/dist/lib/cubing/chunks/twisty-dynamic-3d-JO6OGKOF.js.map +7 -0
- package/dist/lib/cubing/index-BX6f56uo.d.ts +76 -0
- package/dist/lib/cubing/index-CcRu94bx.d.ts +2622 -0
- package/dist/lib/cubing/kpuzzle/index.d.ts +2 -0
- package/dist/lib/cubing/kpuzzle/index.js +12 -0
- package/dist/lib/cubing/kpuzzle/index.js.map +7 -0
- package/dist/lib/cubing/notation/index.d.ts +32 -0
- package/dist/lib/cubing/notation/index.js +20 -0
- package/dist/lib/cubing/notation/index.js.map +7 -0
- package/dist/lib/cubing/outside-BCzgSYQ_.d.ts +38 -0
- package/dist/lib/cubing/protocol/index.d.ts +28 -0
- package/dist/lib/cubing/protocol/index.js +20 -0
- package/dist/lib/cubing/protocol/index.js.map +7 -0
- package/dist/lib/cubing/puzzle-geometry/index.d.ts +2 -0
- package/dist/lib/cubing/puzzle-geometry/index.js +5024 -0
- package/dist/lib/cubing/puzzle-geometry/index.js.map +7 -0
- package/dist/lib/cubing/puzzles/index.d.ts +2 -0
- package/dist/lib/cubing/puzzles/index.js +23 -0
- package/dist/lib/cubing/puzzles/index.js.map +7 -0
- package/dist/lib/cubing/scramble/index.d.ts +2 -0
- package/dist/lib/cubing/scramble/index.js +16 -0
- package/dist/lib/cubing/scramble/index.js.map +7 -0
- package/dist/lib/cubing/search/index.d.ts +7 -0
- package/dist/lib/cubing/search/index.js +37 -0
- package/dist/lib/cubing/search/index.js.map +7 -0
- package/dist/lib/cubing/stream/index.d.ts +2 -0
- package/dist/lib/cubing/stream/index.js +111 -0
- package/dist/lib/cubing/stream/index.js.map +7 -0
- package/dist/lib/cubing/twisty/index.d.ts +2 -0
- package/dist/lib/cubing/twisty/index.js +6236 -0
- package/dist/lib/cubing/twisty/index.js.map +7 -0
- package/experimental-json-schema/kpuzzle/KPatternData.schema.json +34 -0
- package/experimental-json-schema/kpuzzle/KPuzzleDefinition.schema.json +97 -0
- package/experimental-json-schema/kpuzzle/KTransformationData.schema.json +27 -0
- package/kpuzzle/index.d.ts +1 -0
- package/notation/index.d.ts +1 -0
- package/package.json +146 -0
- package/protocol/index.d.ts +1 -0
- package/puzzle-geometry/index.d.ts +1 -0
- package/puzzles/index.d.ts +1 -0
- package/scramble/index.d.ts +1 -0
- package/search/index.d.ts +1 -0
- package/stream/index.d.ts +1 -0
- package/twisty/index.d.ts +1 -0
package/README.md
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
<img src="cubing.js.png" alt="cubing.js" width="512">
|
|
2
|
+
|
|
3
|
+
# `cubing.js` lightweight fork
|
|
4
|
+
|
|
5
|
+
A **lightweight fork of [`cubing.js`](https://github.com/cubing/cubing.js)**: fewer puzzles, smaller lazily-loaded chunks, and some extra visualization features.
|
|
6
|
+
|
|
7
|
+
The API surface, the module layout and the build system are unchanged from upstream, so this is a drop-in replacement for `cubing` as long as you only use the puzzles listed below.
|
|
8
|
+
|
|
9
|
+
- Upstream project: <https://github.com/cubing/cubing.js>
|
|
10
|
+
- Upstream documentation: <https://js.cubing.net/cubing/>
|
|
11
|
+
|
|
12
|
+
## Supported puzzles
|
|
13
|
+
|
|
14
|
+
| Puzzle | ID | 3D | 2D net | 2D last layer | Scrambles |
|
|
15
|
+
| --- | --- | :-: | :-: | :-: | --- |
|
|
16
|
+
| 3×3×3 Cube | `3x3x3` | ✅ | ✅ | ✅ | random-state |
|
|
17
|
+
| 2×2×2 Cube | `2x2x2` | ✅ | ✅ | ✅ | random-state |
|
|
18
|
+
| 4×4×4 Cube | `4x4x4` | ✅ | ❌ | ✅ | random-state |
|
|
19
|
+
| 5×5×5 Cube | `5x5x5` | ✅ | ❌ | ✅ | random-moves |
|
|
20
|
+
| 6×6×6 Cube | `6x6x6` | ✅ | ❌ | ❌ | random-moves |
|
|
21
|
+
| 7×7×7 Cube | `7x7x7` | ✅ | ❌ | ❌ | random-moves |
|
|
22
|
+
| Square-1 | `square1` | ✅ | ✅ | ✅ | random-state |
|
|
23
|
+
| Pyraminx | `pyraminx` | ✅ | ✅ | ❌ | random-state |
|
|
24
|
+
| Megaminx | `megaminx` | ✅ | ❌ | ✅ | random-moves |
|
|
25
|
+
| Clock | `clock` | ❌ | ✅ | ❌ | random-state |
|
|
26
|
+
| Skewb | `skewb` | ✅ | ❌ | ❌ | random-state |
|
|
27
|
+
| Face-Turning Octahedron | `fto` | ✅ | ✅ | ❌ | random-state |
|
|
28
|
+
|
|
29
|
+
Every WCA event is supported (`222`, `333`, `444`, `555`, `666`, `777`, `333bf`, `333fm`, `333oh`, `333mbf`, `444bf`, `555bf`, `clock`, `minx`, `pyram`, `skewb`, `sq1`), plus `fto`.
|
|
30
|
+
|
|
31
|
+
## Breaking changes vs. upstream
|
|
32
|
+
|
|
33
|
+
### Removed puzzles
|
|
34
|
+
|
|
35
|
+
These puzzles are gone from `puzzles`, from `PuzzleID`, and from the `<twisty-player puzzle="…">` attribute. Requesting one throws instead of rendering.
|
|
36
|
+
|
|
37
|
+
| Removed | Upstream ID |
|
|
38
|
+
| --- | --- |
|
|
39
|
+
| Kilominx | `kilominx` |
|
|
40
|
+
| Master Tetraminx | `master_tetraminx` |
|
|
41
|
+
| Gigaminx | `gigaminx` |
|
|
42
|
+
| Redi Cube | `redi_cube` |
|
|
43
|
+
| Baby FTO | `baby_fto` |
|
|
44
|
+
| Melinda's 2×2×2×2 | `melindas2x2x2x2` |
|
|
45
|
+
| Tri-Quad | `tri_quad` |
|
|
46
|
+
| Loopover | `loopover` |
|
|
47
|
+
| 40×40×40 Cube | `40x40x40` |
|
|
48
|
+
|
|
49
|
+
### Removed events
|
|
50
|
+
|
|
51
|
+
`randomScrambleForEvent(…)` no longer accepts the Twizzle-only events that belonged to the removed puzzles: `kilominx`, `master_tetraminx`, `redi_cube`, `baby_fto`, `loopover`. Every WCA event plus `fto` still works.
|
|
52
|
+
|
|
53
|
+
### Other removals
|
|
54
|
+
|
|
55
|
+
- The vendored solvers for the removed puzzles (`kilosolver.js`, `master_tetraminx-solver.js`, `redi_cube.js`) are deleted.
|
|
56
|
+
- The `stress-tests/40x40x40` demo page is deleted, along with its 379 kB solution file.
|
|
57
|
+
- Dynamic chunk entry points were renamed (see [Re-chunking](#re-chunking)). This only matters if you were importing internal `puzzles-dynamic-*` paths directly, which is not part of the public API.
|
|
58
|
+
|
|
59
|
+
## What this fork adds
|
|
60
|
+
|
|
61
|
+
- **Square-1 in 3D.** New `Square1_3D` visualization strategy, now the default for `puzzle="square1"`. Upstream always rendered Square-1 flat.
|
|
62
|
+
- **Square-1 2D last-layer diagrams.** `visualization="experimental-2D-LL"` on `square1`, with `OLL` and `PLL` stickerings.
|
|
63
|
+
- **Better 2D Square-1 rendering.** Piece separator support in the SVG renderer: outlines between two halves of a piece hide and reappear as pieces join and split.
|
|
64
|
+
- **5×5×5 2D last-layer diagrams.** `visualization="experimental-2D-LL"` on `5x5x5`, with a cached SVG built from reusable `<use>` elements.
|
|
65
|
+
- **`L2E` stickering.** Last two edges, for `4x4x4`, `5x5x5` and `6x6x6`, under the Reduction group.
|
|
66
|
+
|
|
67
|
+
## Rendering performance
|
|
68
|
+
|
|
69
|
+
Several per-frame code paths in `cubing/twisty` were doing work that could be skipped. Measured on Chromium as the cost of one `onPositionChange(…)` call with a move in progress (minimum of 7 rounds of 3000 calls), 2026-08-27.
|
|
70
|
+
|
|
71
|
+
| Puzzle | Renderer | Upstream | This fork | Change |
|
|
72
|
+
| --- | --- | --- | --- | --- |
|
|
73
|
+
| 3×3×3 | `Cube3D` | 11.17 µs | **3.87 µs** | -65% |
|
|
74
|
+
| 7×7×7 | `PG3D` | 4.13 µs | **2.27 µs** | -45% |
|
|
75
|
+
| 5×5×5 | `PG3D` | 2.63 µs | **2.00 µs** | -24% |
|
|
76
|
+
| Megaminx | `PG3D` | 2.80 µs | **2.20 µs** | -21% |
|
|
77
|
+
| FTO | `PG3D` | 1.93 µs | **1.70 µs** | -12% |
|
|
78
|
+
| 2×2×2 | `PG3D` | 1.40 µs | **1.27 µs** | -9% |
|
|
79
|
+
|
|
80
|
+
These are small in absolute terms on desktop: a 3×3×3 player drops from roughly 0.67 ms to 0.23 ms of main-thread time per second of animation. It matters for pages with many diagrams, for low-end mobile, and for apps whose main thread is already busy.
|
|
81
|
+
|
|
82
|
+
## Size improvements
|
|
83
|
+
|
|
84
|
+
A snapshot, not a live claim: each entry point bundled with `esbuild` (minified, ESM, `three` external), measured 2026-08-26 against upstream `3efce156`. Expect drift as the fork moves.
|
|
85
|
+
|
|
86
|
+
| Entry point | Upstream | This fork | Change |
|
|
87
|
+
| --- | --- | --- | --- |
|
|
88
|
+
| `cubing/puzzles` | 397 kB · 75 kB gzip | **322 kB · 62 kB gzip** | -19% · -17% gzip |
|
|
89
|
+
| `cubing/twisty` | 554 kB · 122 kB gzip | **479 kB · 109 kB gzip** | -14% · -11% gzip |
|
|
90
|
+
| `cubing/search` | 1251 kB · 351 kB gzip | **1152 kB · 329 kB gzip** | -8% · -6% gzip |
|
|
91
|
+
| `cubing/scramble` | 1249 kB · 350 kB gzip | **1151 kB · 329 kB gzip** | -8% · -6% gzip |
|
|
92
|
+
|
|
93
|
+
### Re-chunking
|
|
94
|
+
|
|
95
|
+
Upstream bundles several puzzles into a single lazily-loaded chunk. Displaying a 2×2×2 in 2D therefore also downloads the Clock and Square-1 artwork. This fork splits those chunks one-per-puzzle, following the per-puzzle convention the cube chunks already used.
|
|
96
|
+
|
|
97
|
+
| Upstream chunk | This fork |
|
|
98
|
+
| --- | --- |
|
|
99
|
+
| `puzzles-dynamic-side-events` (123 kB)<br>2×2×2 + Clock + Pyraminx + Square-1 | `puzzles-dynamic-2x2x2` 7 kB<br>`puzzles-dynamic-clock` 48 kB<br>`puzzles-dynamic-pyraminx` 5 kB<br>`puzzles-dynamic-square1` 62 kB |
|
|
100
|
+
| `puzzles-dynamic-unofficial` (44 kB)<br>FTO + Baby FTO + Kilominx + Loopover + Redi Cube | `puzzles-dynamic-fto` 11 kB |
|
|
101
|
+
| `search-dynamic-sgs-side-events` (33 kB)<br>2×2×2 + Megaminx + Pyraminx + Skewb | `search-dynamic-sgs-2x2x2` 1 kB<br>`search-dynamic-sgs-megaminx` 28 kB<br>`search-dynamic-sgs-pyraminx` 1 kB<br>`search-dynamic-sgs-skewb` 2 kB |
|
|
102
|
+
|
|
103
|
+
### What a browser actually downloads
|
|
104
|
+
|
|
105
|
+
Everything is lazily loaded, so the numbers that matter are per-scenario, not per-package. Gzipped, `three.js` excluded:
|
|
106
|
+
|
|
107
|
+
| Scenario | Download |
|
|
108
|
+
| --- | --- |
|
|
109
|
+
| `cubing/scramble` imported, nothing generated yet | 41 kB |
|
|
110
|
+
| First 3×3×3 or 4×4×4 scramble | 66 kB |
|
|
111
|
+
| Any other event (pulls the WASM scramble engine) | 376 kB |
|
|
112
|
+
| `cubing/twisty` initial load | 86 kB |
|
|
113
|
+
| `cubing/twisty` with 3D and every puzzle | 162 kB + `three.js` |
|
|
114
|
+
|
|
115
|
+
### Known remaining weight
|
|
116
|
+
|
|
117
|
+
Two items dominate what is left, and neither is about the puzzle list:
|
|
118
|
+
|
|
119
|
+
- **The WASM scramble engine, 209 kB gzip.** It is base64-inlined into a `.js` file, which inflates the binary by 33% and compresses worse than the binary would. Shipping it as a real `.wasm` asset would bring it to 152 kB gzip. Upstream disabled that path on purpose until bundler support settled, so re-enabling it is a packaging decision rather than a code one.
|
|
120
|
+
- **`three.js`, 134 kB gzip.** Only downloaded when the player renders in 3D. Setting `visualization="2D"` avoids it entirely. The `three` imports inside `cubing/twisty` are all `import type`, so there is nothing left to tree-shake there.
|
package/alg/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type * from "../dist/lib/cubing/alg/index.d.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type * from "../dist/lib/cubing/bluetooth/index.d.ts";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env -S node --
|
|
2
|
+
|
|
3
|
+
// src/metadata/packageVersion.ts
|
|
4
|
+
var packageVersion = (
|
|
5
|
+
// biome-ignore lint/suspicious/noTsIgnore: This comment is stil present in the compiled file, where an error is *not* expected.
|
|
6
|
+
/** @ts-ignore Populated by `esbuild` at compile time. */
|
|
7
|
+
"0.63.5"
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
export {
|
|
11
|
+
packageVersion
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=chunk-22VWCGBC.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/metadata/packageVersion.ts"],
|
|
4
|
+
"sourcesContent": ["export const packageVersion: string =\n // biome-ignore lint/suspicious/noTsIgnore: This comment is stil present in the compiled file, where an error is *not* expected.\n /** @ts-ignore Populated by `esbuild` at compile time. */\n globalThis.PACKAGE_VERSION ??\n // We don't want to pull in the dynamic code into the import graph, so we use\n // dynamic import here. This entire fallback expression should get compiled\n // out by `esbuild`.\n (await import(\"./packageVersionDynamic\")).version;\n"],
|
|
5
|
+
"mappings": ";;;AAAO,IAAM;AAAA;AAAA;AAAA,EAGX;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
#!/usr/bin/env -S node --
|
|
2
|
+
import {
|
|
3
|
+
packageVersion
|
|
4
|
+
} from "./chunks/chunk-22VWCGBC.js";
|
|
5
|
+
|
|
6
|
+
// src/bin/order.ts
|
|
7
|
+
import { basename } from "node:path";
|
|
8
|
+
import { argv } from "node:process";
|
|
9
|
+
import { argument, map, message, object, string } from "@optique/core";
|
|
10
|
+
import { run } from "@optique/run";
|
|
11
|
+
import { Alg } from "@rednaxela101/cubing/alg";
|
|
12
|
+
import { KPuzzle } from "@rednaxela101/cubing/kpuzzle";
|
|
13
|
+
import { getPuzzleGeometryByName } from "@rednaxela101/cubing/puzzle-geometry";
|
|
14
|
+
import { puzzles } from "@rednaxela101/cubing/puzzles";
|
|
15
|
+
var args = run(
|
|
16
|
+
object({
|
|
17
|
+
puzzleGeometryID: argument(string({ metavar: "PUZZLE" }), {
|
|
18
|
+
description: message`Puzzle geometry ID`
|
|
19
|
+
}),
|
|
20
|
+
alg: map(
|
|
21
|
+
argument(string({ metavar: "ALG" }), {
|
|
22
|
+
description: message`Alg`
|
|
23
|
+
}),
|
|
24
|
+
Alg.fromString
|
|
25
|
+
)
|
|
26
|
+
}),
|
|
27
|
+
{
|
|
28
|
+
programName: basename(argv[1]),
|
|
29
|
+
description: message`Example: order 3x3x3 "R U R' U R U2' R'"`,
|
|
30
|
+
help: "option",
|
|
31
|
+
completion: {
|
|
32
|
+
option: {
|
|
33
|
+
names: ["--completions"],
|
|
34
|
+
hidden: false
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
version: {
|
|
38
|
+
option: {
|
|
39
|
+
hidden: false
|
|
40
|
+
},
|
|
41
|
+
value: packageVersion
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
var { puzzleGeometryID, alg } = args;
|
|
46
|
+
var puzzleLoader = puzzles[puzzleGeometryID];
|
|
47
|
+
var kpuzzle = await (async () => {
|
|
48
|
+
if (puzzleLoader) {
|
|
49
|
+
return await puzzles[puzzleGeometryID].kpuzzle();
|
|
50
|
+
} else {
|
|
51
|
+
const pg = getPuzzleGeometryByName(puzzleGeometryID, {
|
|
52
|
+
allMoves: true
|
|
53
|
+
});
|
|
54
|
+
return new KPuzzle(pg.getKPuzzleDefinition(true));
|
|
55
|
+
}
|
|
56
|
+
})();
|
|
57
|
+
var order = kpuzzle.algToTransformation(alg).repetitionOrder();
|
|
58
|
+
console.log(order);
|
|
59
|
+
//# sourceMappingURL=order.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/bin/order.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n\nTo run this file directly:\n\n```shell\nbun run -- ./src/bin/order.ts 3x3x3 \"R U R' U R U2' R'\"\n```\n\nTo add an `order` binary to your path and test completions:\n\n```shell\n# fish (from repo root)\nset PATH (pwd)/src/test/bin-path $PATH\norder --completions fish | source\n```\n\n```shell\n# zsh (from repo root)\nautoload -Uz compinit\ncompinit\nexport PATH=$(pwd)/src/test/bin-path:$PATH\nsource <(order --completions zsh)\n```\n\n*/\n\nimport { basename } from \"node:path\";\nimport { argv } from \"node:process\";\nimport { argument, map, message, object, string } from \"@optique/core\";\nimport { run } from \"@optique/run\";\nimport { Alg } from \"@rednaxela101/cubing/alg\";\nimport { KPuzzle } from \"@rednaxela101/cubing/kpuzzle\";\nimport { getPuzzleGeometryByName } from \"@rednaxela101/cubing/puzzle-geometry\";\nimport { puzzles } from \"@rednaxela101/cubing/puzzles\";\nimport { packageVersion } from \"../metadata/packageVersion\";\n\nconst args = run(\n object({\n puzzleGeometryID: argument(string({ metavar: \"PUZZLE\" }), {\n description: message`Puzzle geometry ID`,\n }),\n alg: map(\n argument(string({ metavar: \"ALG\" }), {\n description: message`Alg`,\n }),\n Alg.fromString,\n ),\n }),\n {\n programName: basename(argv[1]),\n description: message`Example: order 3x3x3 \"R U R' U R U2' R'\"`,\n help: \"option\",\n completion: {\n option: {\n names: [\"--completions\"],\n hidden: false,\n },\n },\n version: {\n option: {\n hidden: false,\n },\n value: packageVersion,\n },\n },\n);\n\nconst { puzzleGeometryID, alg } = args;\n\n/*\n * Turn a name into a geometry.\n */\nconst puzzleLoader = puzzles[puzzleGeometryID];\nconst kpuzzle = await (async () => {\n if (puzzleLoader) {\n return await puzzles[puzzleGeometryID].kpuzzle();\n } else {\n const pg = getPuzzleGeometryByName(puzzleGeometryID, {\n allMoves: true,\n });\n return new KPuzzle(pg.getKPuzzleDefinition(true));\n }\n})();\n\nconst order = kpuzzle.algToTransformation(alg).repetitionOrder();\nconsole.log(order);\n"],
|
|
5
|
+
"mappings": ";;;;;;AA0BA,SAAS,gBAAgB;AACzB,SAAS,YAAY;AACrB,SAAS,UAAU,KAAK,SAAS,QAAQ,cAAc;AACvD,SAAS,WAAW;AACpB,SAAS,WAAW;AACpB,SAAS,eAAe;AACxB,SAAS,+BAA+B;AACxC,SAAS,eAAe;AAGxB,IAAM,OAAO;AAAA,EACX,OAAO;AAAA,IACL,kBAAkB,SAAS,OAAO,EAAE,SAAS,SAAS,CAAC,GAAG;AAAA,MACxD,aAAa;AAAA,IACf,CAAC;AAAA,IACD,KAAK;AAAA,MACH,SAAS,OAAO,EAAE,SAAS,MAAM,CAAC,GAAG;AAAA,QACnC,aAAa;AAAA,MACf,CAAC;AAAA,MACD,IAAI;AAAA,IACN;AAAA,EACF,CAAC;AAAA,EACD;AAAA,IACE,aAAa,SAAS,KAAK,CAAC,CAAC;AAAA,IAC7B,aAAa;AAAA,IACb,MAAM;AAAA,IACN,YAAY;AAAA,MACV,QAAQ;AAAA,QACN,OAAO,CAAC,eAAe;AAAA,QACvB,QAAQ;AAAA,MACV;AAAA,IACF;AAAA,IACA,SAAS;AAAA,MACP,QAAQ;AAAA,QACN,QAAQ;AAAA,MACV;AAAA,MACA,OAAO;AAAA,IACT;AAAA,EACF;AACF;AAEA,IAAM,EAAE,kBAAkB,IAAI,IAAI;AAKlC,IAAM,eAAe,QAAQ,gBAAgB;AAC7C,IAAM,UAAU,OAAO,YAAY;AACjC,MAAI,cAAc;AAChB,WAAO,MAAM,QAAQ,gBAAgB,EAAE,QAAQ;AAAA,EACjD,OAAO;AACL,UAAM,KAAK,wBAAwB,kBAAkB;AAAA,MACnD,UAAU;AAAA,IACZ,CAAC;AACD,WAAO,IAAI,QAAQ,GAAG,qBAAqB,IAAI,CAAC;AAAA,EAClD;AACF,GAAG;AAEH,IAAM,QAAQ,QAAQ,oBAAoB,GAAG,EAAE,gBAAgB;AAC/D,QAAQ,IAAI,KAAK;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
#!/usr/bin/env -S node --
|
|
2
|
+
import {
|
|
3
|
+
packageVersion
|
|
4
|
+
} from "./chunks/chunk-22VWCGBC.js";
|
|
5
|
+
|
|
6
|
+
// src/bin/puzzle-geometry-bin.ts
|
|
7
|
+
import { basename } from "node:path";
|
|
8
|
+
import { argv } from "node:process";
|
|
9
|
+
import {
|
|
10
|
+
argument,
|
|
11
|
+
constant,
|
|
12
|
+
flag,
|
|
13
|
+
integer,
|
|
14
|
+
map,
|
|
15
|
+
merge,
|
|
16
|
+
message,
|
|
17
|
+
multiple,
|
|
18
|
+
object,
|
|
19
|
+
option,
|
|
20
|
+
optional,
|
|
21
|
+
or,
|
|
22
|
+
string
|
|
23
|
+
} from "@optique/core";
|
|
24
|
+
import { run } from "@optique/run";
|
|
25
|
+
import { Move } from "@rednaxela101/cubing/alg";
|
|
26
|
+
import {
|
|
27
|
+
getPG3DNamedPuzzles,
|
|
28
|
+
PuzzleGeometry,
|
|
29
|
+
parsePuzzleDescription
|
|
30
|
+
} from "@rednaxela101/cubing/puzzle-geometry";
|
|
31
|
+
import { PrintableShellCommand } from "printable-shell-command";
|
|
32
|
+
var puzzleList = getPG3DNamedPuzzles();
|
|
33
|
+
function antiBool(optionName, description) {
|
|
34
|
+
return optional(
|
|
35
|
+
map(
|
|
36
|
+
flag(optionName, {
|
|
37
|
+
description
|
|
38
|
+
}),
|
|
39
|
+
(v) => !v
|
|
40
|
+
)
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
var subcommandDefaults = {
|
|
44
|
+
commentStyle: constant("hash"),
|
|
45
|
+
forceQuiet: constant(void 0)
|
|
46
|
+
};
|
|
47
|
+
var args = run(
|
|
48
|
+
merge(
|
|
49
|
+
object({
|
|
50
|
+
verbosity: optional(
|
|
51
|
+
or(
|
|
52
|
+
map(multiple(flag("--verbose", "-v")), (v) => v.length),
|
|
53
|
+
map(flag("--quiet", "-q"), () => 0)
|
|
54
|
+
)
|
|
55
|
+
)
|
|
56
|
+
}),
|
|
57
|
+
or(
|
|
58
|
+
object({
|
|
59
|
+
...subcommandDefaults,
|
|
60
|
+
subcommand: constant("KSolve"),
|
|
61
|
+
subcommandFlag: flag("--ksolve", {
|
|
62
|
+
description: message`Print KSolve (\`.tws\`).`
|
|
63
|
+
})
|
|
64
|
+
}),
|
|
65
|
+
object({
|
|
66
|
+
...subcommandDefaults,
|
|
67
|
+
subcommand: constant("SVG"),
|
|
68
|
+
subcommandFlag: flag("--svg", {
|
|
69
|
+
description: message`Print SVG. Forces \`--quiet\`.`
|
|
70
|
+
}),
|
|
71
|
+
commentStyle: constant("none"),
|
|
72
|
+
svg3D: optional(
|
|
73
|
+
option("--3d", {
|
|
74
|
+
description: message`Use 3D format for SVG file.`
|
|
75
|
+
})
|
|
76
|
+
),
|
|
77
|
+
verbosity: constant(0)
|
|
78
|
+
}),
|
|
79
|
+
object({
|
|
80
|
+
...subcommandDefaults,
|
|
81
|
+
subcommand: constant("GAP"),
|
|
82
|
+
subcommandFlag: flag("--gap", {
|
|
83
|
+
description: message`Print GAP output.`
|
|
84
|
+
})
|
|
85
|
+
}),
|
|
86
|
+
object({
|
|
87
|
+
...subcommandDefaults,
|
|
88
|
+
subcommand: constant("Mathematica"),
|
|
89
|
+
subcommandFlag: flag("--mathematica", {
|
|
90
|
+
description: message`Print Mathematica output.`
|
|
91
|
+
}),
|
|
92
|
+
commentStyle: constant("Pascal")
|
|
93
|
+
}),
|
|
94
|
+
object({
|
|
95
|
+
...subcommandDefaults,
|
|
96
|
+
subcommand: constant("Schreier-Sims"),
|
|
97
|
+
subcommandFlag: flag("--ss", {
|
|
98
|
+
description: message`Perform Schrier-Sims calculation.`
|
|
99
|
+
})
|
|
100
|
+
}),
|
|
101
|
+
object({
|
|
102
|
+
...subcommandDefaults,
|
|
103
|
+
subcommand: constant("Canonical string analysis"),
|
|
104
|
+
subcommandFlag: flag("--canon", {
|
|
105
|
+
description: message`Print canonical string analysis.`
|
|
106
|
+
})
|
|
107
|
+
}),
|
|
108
|
+
object({
|
|
109
|
+
...subcommandDefaults,
|
|
110
|
+
subcommand: constant("3D"),
|
|
111
|
+
subcommandFlag: flag("--3d", {
|
|
112
|
+
description: message`Print 3D information.`
|
|
113
|
+
})
|
|
114
|
+
})
|
|
115
|
+
),
|
|
116
|
+
object({
|
|
117
|
+
// This doesn't apply to SVG, but we place it here so that it doesn't print once for each non-SVG subcommand in the help string.
|
|
118
|
+
optimizeOrbits: option("--optimize", {
|
|
119
|
+
description: message`Optimize output (when possible).`
|
|
120
|
+
}),
|
|
121
|
+
addRotations: option("--rotations", {
|
|
122
|
+
description: message`Include full-puzzle rotations as moves.`
|
|
123
|
+
}),
|
|
124
|
+
allMoves: option("--allmoves", {
|
|
125
|
+
description: message`Includes all moves (i.e., slice moves for 3x3x3).`
|
|
126
|
+
}),
|
|
127
|
+
outerBlockMoves: option("--outerblockmoves", {
|
|
128
|
+
description: message`Use outer block moves rather than slice moves.`
|
|
129
|
+
}),
|
|
130
|
+
vertexMoves: option("--vertexmoves", {
|
|
131
|
+
description: message`For tetrahedral puzzles, prefer vertex moves to face moves.`
|
|
132
|
+
}),
|
|
133
|
+
includeCornerOrbits: antiBool(
|
|
134
|
+
"--nocorners",
|
|
135
|
+
message`Ignore all corners.`
|
|
136
|
+
),
|
|
137
|
+
excludeOrbits: optional(
|
|
138
|
+
map(
|
|
139
|
+
option("--omit", string({ metavar: "COMMA_SEPARATED_ORBITS" }), {
|
|
140
|
+
description: message`Omit orbits.`
|
|
141
|
+
}),
|
|
142
|
+
(s) => s.split(",")
|
|
143
|
+
)
|
|
144
|
+
),
|
|
145
|
+
includeEdgeOrbits: antiBool("--noedges", message`Ignore all edges.`),
|
|
146
|
+
includeCenterOrbits: antiBool(
|
|
147
|
+
"--nocenters",
|
|
148
|
+
message`Ignore all centers.`
|
|
149
|
+
),
|
|
150
|
+
grayCorners: option("--graycorners", {
|
|
151
|
+
description: message`Gray corners.`
|
|
152
|
+
}),
|
|
153
|
+
grayEdges: option("--grayedges", { description: message`Gray edges.` }),
|
|
154
|
+
grayCenters: option("--graycenters", {
|
|
155
|
+
description: message`Gray centers.`
|
|
156
|
+
}),
|
|
157
|
+
fixedOrientation: option("--noorientation", {
|
|
158
|
+
description: message`Ignore orientations.`
|
|
159
|
+
}),
|
|
160
|
+
orientCenters: option("--orientcenters", {
|
|
161
|
+
description: message`Give centers an orientation.`
|
|
162
|
+
})
|
|
163
|
+
}),
|
|
164
|
+
optional(
|
|
165
|
+
or(
|
|
166
|
+
object({
|
|
167
|
+
puzzleOrientation: optional(
|
|
168
|
+
map(
|
|
169
|
+
option(
|
|
170
|
+
"--puzzleorientation",
|
|
171
|
+
string({ metavar: "JSON_STRING" }),
|
|
172
|
+
{
|
|
173
|
+
description: message`For 3D formats, give puzzle orientation.`
|
|
174
|
+
}
|
|
175
|
+
),
|
|
176
|
+
(s) => JSON.parse(s)
|
|
177
|
+
)
|
|
178
|
+
),
|
|
179
|
+
puzzleOrientations: constant(void 0)
|
|
180
|
+
}),
|
|
181
|
+
object({
|
|
182
|
+
puzzleOrientation: constant(void 0),
|
|
183
|
+
puzzleOrientations: optional(
|
|
184
|
+
map(
|
|
185
|
+
option(
|
|
186
|
+
"--puzzleorientations",
|
|
187
|
+
string({ metavar: "JSON_STRING" }),
|
|
188
|
+
{
|
|
189
|
+
description: message`For 3D formats, give puzzle orientations.`
|
|
190
|
+
}
|
|
191
|
+
),
|
|
192
|
+
(s) => JSON.parse(s)
|
|
193
|
+
)
|
|
194
|
+
)
|
|
195
|
+
})
|
|
196
|
+
)
|
|
197
|
+
),
|
|
198
|
+
object({
|
|
199
|
+
fixedPieceType: optional(
|
|
200
|
+
or(
|
|
201
|
+
map(
|
|
202
|
+
flag("--fixcorner", {
|
|
203
|
+
description: message`Auto-select a subset of moves to keep a corner fixed in place.`
|
|
204
|
+
}),
|
|
205
|
+
() => "v"
|
|
206
|
+
),
|
|
207
|
+
map(
|
|
208
|
+
flag("--fixedge", {
|
|
209
|
+
description: message`Auto-select a subset of moves to keep an edge fixed in place.`
|
|
210
|
+
}),
|
|
211
|
+
() => "e"
|
|
212
|
+
),
|
|
213
|
+
map(
|
|
214
|
+
flag("--fixcenter", {
|
|
215
|
+
description: message`Auto-select a subset of moves to keep a center fixed in place.`
|
|
216
|
+
}),
|
|
217
|
+
() => "f"
|
|
218
|
+
)
|
|
219
|
+
)
|
|
220
|
+
),
|
|
221
|
+
// TODO: this doesn't make sense for all subcommands?
|
|
222
|
+
scrambleAmount: optional(
|
|
223
|
+
option("--scramble", integer({ min: 0 }), {
|
|
224
|
+
description: message`Scramble solved position.`
|
|
225
|
+
})
|
|
226
|
+
),
|
|
227
|
+
moveList: optional(
|
|
228
|
+
map(
|
|
229
|
+
option("--moves", string({ metavar: "COMMA_SEPARATED_MOVES" }), {
|
|
230
|
+
description: message`Restrict moves to this list. Example: \"U2,F,r\").`
|
|
231
|
+
}),
|
|
232
|
+
(s) => s.split(",").map((m) => Move.fromString(m))
|
|
233
|
+
)
|
|
234
|
+
),
|
|
235
|
+
puzzle: map(
|
|
236
|
+
argument(string({ metavar: "PUZZLE" }), {
|
|
237
|
+
description: message`The puzzle can be given as a geometric description or by name.
|
|
238
|
+
The geometric description starts with one of:
|
|
239
|
+
|
|
240
|
+
- \`c\` (cube),\n
|
|
241
|
+
- \`t\` (tetrahedron),\n
|
|
242
|
+
- \`d\` (dodecahedron),\n
|
|
243
|
+
- \`i\` (icosahedron),\n
|
|
244
|
+
- \`o\` (octahedron),\n
|
|
245
|
+
|
|
246
|
+
then a space, then a series of cuts. Each cut begins with one of:
|
|
247
|
+
|
|
248
|
+
- \`f\` (for a cut parallel to faces),\n
|
|
249
|
+
- \`v\` (for a cut perpendicular to a ray from the center through a corner),\n
|
|
250
|
+
- \`e\` (for a cut perpendicular to a ray from the center through an edge),\n
|
|
251
|
+
|
|
252
|
+
followed by a decimal number giving a distance, where 1 is the distance
|
|
253
|
+
between the center of the puzzle and the center of a face.
|
|
254
|
+
|
|
255
|
+
Example description: \`c f 0 v 0.577350269189626 e 0\`. Corresponds to: https://alpha.twizzle.net/explore/?puzzle=2x2x2+%2B+dino+%2B+little+chop
|
|
256
|
+
|
|
257
|
+
The recognized puzzle names are: ${Object.keys(puzzleList).map((p) => JSON.stringify(p)).join(", ")}`
|
|
258
|
+
}),
|
|
259
|
+
(s) => {
|
|
260
|
+
const parsed = parsePuzzleDescription(puzzleList[s] ?? s);
|
|
261
|
+
if (parsed === null) {
|
|
262
|
+
throw new Error("Could not parse puzzle description!");
|
|
263
|
+
}
|
|
264
|
+
return parsed;
|
|
265
|
+
}
|
|
266
|
+
)
|
|
267
|
+
})
|
|
268
|
+
),
|
|
269
|
+
{
|
|
270
|
+
programName: basename(argv[1]),
|
|
271
|
+
description: message`
|
|
272
|
+
Examples:
|
|
273
|
+
|
|
274
|
+
puzzle-geometry --ss 2x2x2\n
|
|
275
|
+
puzzle-geometry --ss --fixcorner 2x2x2\n
|
|
276
|
+
puzzle-geometry --ss --moves U,F2,r 4x4x4\n
|
|
277
|
+
puzzle-geometry --ksolve --optimize --moves U,F,R megaminx\n
|
|
278
|
+
puzzle-geometry --gap --noedges megaminx
|
|
279
|
+
`,
|
|
280
|
+
help: "option",
|
|
281
|
+
completion: {
|
|
282
|
+
option: {
|
|
283
|
+
names: ["--completions"],
|
|
284
|
+
hidden: false
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
version: {
|
|
288
|
+
option: {
|
|
289
|
+
hidden: false
|
|
290
|
+
},
|
|
291
|
+
value: packageVersion
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
);
|
|
295
|
+
if (args.verbosity !== 0) {
|
|
296
|
+
const cmd = () => {
|
|
297
|
+
const [command, ...args2] = argv;
|
|
298
|
+
return new PrintableShellCommand(command, args2).getPrintableCommand({
|
|
299
|
+
argumentLineWrapping: "inline"
|
|
300
|
+
});
|
|
301
|
+
};
|
|
302
|
+
switch (args.commentStyle) {
|
|
303
|
+
case "hash": {
|
|
304
|
+
console.log(`# ${cmd()}`);
|
|
305
|
+
break;
|
|
306
|
+
}
|
|
307
|
+
case "none": {
|
|
308
|
+
break;
|
|
309
|
+
}
|
|
310
|
+
case "Pascal": {
|
|
311
|
+
console.log(`(* ${cmd()} *)`);
|
|
312
|
+
break;
|
|
313
|
+
}
|
|
314
|
+
default:
|
|
315
|
+
throw new Error("Invalid comment style.");
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
function buildPuzzleGeometry() {
|
|
319
|
+
const {
|
|
320
|
+
verbosity,
|
|
321
|
+
optimizeOrbits,
|
|
322
|
+
addRotations,
|
|
323
|
+
allMoves,
|
|
324
|
+
outerBlockMoves,
|
|
325
|
+
vertexMoves,
|
|
326
|
+
includeCornerOrbits,
|
|
327
|
+
includeCenterOrbits,
|
|
328
|
+
includeEdgeOrbits,
|
|
329
|
+
excludeOrbits,
|
|
330
|
+
grayCorners,
|
|
331
|
+
grayEdges,
|
|
332
|
+
grayCenters,
|
|
333
|
+
fixedOrientation,
|
|
334
|
+
orientCenters,
|
|
335
|
+
puzzleOrientation,
|
|
336
|
+
puzzleOrientations,
|
|
337
|
+
fixedPieceType,
|
|
338
|
+
scrambleAmount,
|
|
339
|
+
moveList
|
|
340
|
+
} = args;
|
|
341
|
+
const options = {
|
|
342
|
+
verbosity,
|
|
343
|
+
optimizeOrbits,
|
|
344
|
+
addRotations,
|
|
345
|
+
allMoves,
|
|
346
|
+
outerBlockMoves,
|
|
347
|
+
vertexMoves,
|
|
348
|
+
includeCornerOrbits,
|
|
349
|
+
includeCenterOrbits,
|
|
350
|
+
includeEdgeOrbits,
|
|
351
|
+
excludeOrbits,
|
|
352
|
+
grayCorners,
|
|
353
|
+
grayEdges,
|
|
354
|
+
grayCenters,
|
|
355
|
+
fixedOrientation,
|
|
356
|
+
orientCenters,
|
|
357
|
+
puzzleOrientation,
|
|
358
|
+
puzzleOrientations,
|
|
359
|
+
fixedPieceType,
|
|
360
|
+
scrambleAmount,
|
|
361
|
+
moveList
|
|
362
|
+
};
|
|
363
|
+
const puzzleGeometry = new PuzzleGeometry(args.puzzle, options);
|
|
364
|
+
puzzleGeometry.allstickers();
|
|
365
|
+
puzzleGeometry.genperms();
|
|
366
|
+
return puzzleGeometry;
|
|
367
|
+
}
|
|
368
|
+
switch (args.subcommand) {
|
|
369
|
+
case "KSolve": {
|
|
370
|
+
console.log(buildPuzzleGeometry().writeksolve());
|
|
371
|
+
break;
|
|
372
|
+
}
|
|
373
|
+
case "SVG": {
|
|
374
|
+
console.log(
|
|
375
|
+
buildPuzzleGeometry().generatesvg(
|
|
376
|
+
void 0,
|
|
377
|
+
void 0,
|
|
378
|
+
void 0,
|
|
379
|
+
args.svg3D
|
|
380
|
+
)
|
|
381
|
+
);
|
|
382
|
+
break;
|
|
383
|
+
}
|
|
384
|
+
case "GAP": {
|
|
385
|
+
console.log(buildPuzzleGeometry().writegap());
|
|
386
|
+
break;
|
|
387
|
+
}
|
|
388
|
+
case "Mathematica": {
|
|
389
|
+
console.log(buildPuzzleGeometry().writemathematica());
|
|
390
|
+
break;
|
|
391
|
+
}
|
|
392
|
+
case "Schreier-Sims": {
|
|
393
|
+
buildPuzzleGeometry().writeSchreierSims(console.log);
|
|
394
|
+
break;
|
|
395
|
+
}
|
|
396
|
+
case "Canonical string analysis": {
|
|
397
|
+
buildPuzzleGeometry().showcanon(console.log);
|
|
398
|
+
break;
|
|
399
|
+
}
|
|
400
|
+
case "3D": {
|
|
401
|
+
console.log(JSON.stringify(buildPuzzleGeometry().get3d(), null, " "));
|
|
402
|
+
break;
|
|
403
|
+
}
|
|
404
|
+
default:
|
|
405
|
+
throw new Error("Invalid subcommand.");
|
|
406
|
+
}
|
|
407
|
+
//# sourceMappingURL=puzzle-geometry-bin.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/bin/puzzle-geometry-bin.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n\nTo run this file directly:\n\n```shell\nbun run -- ./src/bin/puzzle-geometry-bin.ts <program args>\n```\n\nTo add a `puzzle-geometry` binary to your path and test completions:\n\n```shell\n# fish (from repo root)\nset PATH (pwd)/src/test/bin-path $PATH\npuzzle-geometry --completions fish | source\n```\n\n```shell\n# zsh (from repo root)\nautoload -Uz compinit\ncompinit\nexport PATH=$(pwd)/src/test/bin-path:$PATH\nsource <(puzzle-geometry --completions zsh)\n```\n\n*/\n\nimport { basename } from \"node:path\";\nimport { argv } from \"node:process\";\nimport {\n argument,\n constant,\n flag,\n integer,\n type Message,\n map,\n merge,\n message,\n multiple,\n type OptionName,\n object,\n option,\n optional,\n or,\n string,\n} from \"@optique/core\";\nimport { run } from \"@optique/run\";\nimport { Move } from \"@rednaxela101/cubing/alg\";\nimport {\n type ExperimentalPuzzleGeometryOptions,\n getPG3DNamedPuzzles,\n PuzzleGeometry,\n parsePuzzleDescription,\n} from \"@rednaxela101/cubing/puzzle-geometry\";\nimport { PrintableShellCommand } from \"printable-shell-command\";\nimport { packageVersion } from \"../metadata/packageVersion\";\n\nconst puzzleList = getPG3DNamedPuzzles();\n\n// TODO: make this a `ValueParser`?\nfunction antiBool(optionName: OptionName, description: Message) {\n return optional(\n map(\n flag(optionName, {\n description,\n }),\n (v) => !v,\n ),\n );\n}\n\n// Include using `...subcommandDefaults` at the *beginning* of a subcommand `object({ \u2026 })`.\nconst subcommandDefaults = {\n commentStyle: constant(\"hash\"),\n forceQuiet: constant(undefined),\n} as const;\n\nconst args = run(\n merge(\n object({\n verbosity: optional(\n or(\n map(multiple(flag(\"--verbose\", \"-v\")), (v) => v.length),\n map(flag(\"--quiet\", \"-q\"), () => 0),\n ),\n ),\n }),\n or(\n object({\n ...subcommandDefaults,\n subcommand: constant(\"KSolve\"),\n subcommandFlag: flag(\"--ksolve\", {\n description: message`Print KSolve (\\`.tws\\`).`,\n }),\n }),\n object({\n ...subcommandDefaults,\n subcommand: constant(\"SVG\"),\n subcommandFlag: flag(\"--svg\", {\n description: message`Print SVG. Forces \\`--quiet\\`.`,\n }),\n commentStyle: constant(\"none\"),\n svg3D: optional(\n option(\"--3d\", {\n description: message`Use 3D format for SVG file.`,\n }),\n ),\n verbosity: constant(0),\n }),\n object({\n ...subcommandDefaults,\n subcommand: constant(\"GAP\"),\n subcommandFlag: flag(\"--gap\", {\n description: message`Print GAP output.`,\n }),\n }),\n object({\n ...subcommandDefaults,\n subcommand: constant(\"Mathematica\"),\n subcommandFlag: flag(\"--mathematica\", {\n description: message`Print Mathematica output.`,\n }),\n commentStyle: constant(\"Pascal\"),\n }),\n object({\n ...subcommandDefaults,\n subcommand: constant(\"Schreier-Sims\"),\n subcommandFlag: flag(\"--ss\", {\n description: message`Perform Schrier-Sims calculation.`,\n }),\n }),\n object({\n ...subcommandDefaults,\n subcommand: constant(\"Canonical string analysis\"),\n subcommandFlag: flag(\"--canon\", {\n description: message`Print canonical string analysis.`,\n }),\n }),\n object({\n ...subcommandDefaults,\n subcommand: constant(\"3D\"),\n subcommandFlag: flag(\"--3d\", {\n description: message`Print 3D information.`,\n }),\n }),\n ),\n object({\n // This doesn't apply to SVG, but we place it here so that it doesn't print once for each non-SVG subcommand in the help string.\n optimizeOrbits: option(\"--optimize\", {\n description: message`Optimize output (when possible).`,\n }),\n addRotations: option(\"--rotations\", {\n description: message`Include full-puzzle rotations as moves.`,\n }),\n allMoves: option(\"--allmoves\", {\n description: message`Includes all moves (i.e., slice moves for 3x3x3).`,\n }),\n outerBlockMoves: option(\"--outerblockmoves\", {\n description: message`Use outer block moves rather than slice moves.`,\n }),\n vertexMoves: option(\"--vertexmoves\", {\n description: message`For tetrahedral puzzles, prefer vertex moves to face moves.`,\n }),\n includeCornerOrbits: antiBool(\n \"--nocorners\",\n message`Ignore all corners.`,\n ),\n excludeOrbits: optional(\n map(\n option(\"--omit\", string({ metavar: \"COMMA_SEPARATED_ORBITS\" }), {\n description: message`Omit orbits.`,\n }),\n (s) => s.split(\",\"),\n ),\n ),\n includeEdgeOrbits: antiBool(\"--noedges\", message`Ignore all edges.`),\n includeCenterOrbits: antiBool(\n \"--nocenters\",\n message`Ignore all centers.`,\n ),\n grayCorners: option(\"--graycorners\", {\n description: message`Gray corners.`,\n }),\n grayEdges: option(\"--grayedges\", { description: message`Gray edges.` }),\n grayCenters: option(\"--graycenters\", {\n description: message`Gray centers.`,\n }),\n fixedOrientation: option(\"--noorientation\", {\n description: message`Ignore orientations.`,\n }),\n orientCenters: option(\"--orientcenters\", {\n description: message`Give centers an orientation.`,\n }),\n }),\n optional(\n or(\n object({\n puzzleOrientation: optional(\n map(\n option(\n \"--puzzleorientation\",\n string({ metavar: \"JSON_STRING\" }),\n {\n description: message`For 3D formats, give puzzle orientation.`,\n },\n ),\n (s) => JSON.parse(s),\n ),\n ),\n puzzleOrientations: constant(undefined),\n }),\n object({\n puzzleOrientation: constant(undefined),\n puzzleOrientations: optional(\n map(\n option(\n \"--puzzleorientations\",\n string({ metavar: \"JSON_STRING\" }),\n {\n description: message`For 3D formats, give puzzle orientations.`,\n },\n ),\n (s) => JSON.parse(s),\n ),\n ),\n }),\n ),\n ),\n object({\n fixedPieceType: optional(\n or(\n map(\n flag(\"--fixcorner\", {\n description: message`Auto-select a subset of moves to keep a corner fixed in place.`,\n }),\n () => \"v\" as const,\n ),\n map(\n flag(\"--fixedge\", {\n description: message`Auto-select a subset of moves to keep an edge fixed in place.`,\n }),\n () => \"e\" as const,\n ),\n map(\n flag(\"--fixcenter\", {\n description: message`Auto-select a subset of moves to keep a center fixed in place.`,\n }),\n () => \"f\" as const,\n ),\n ),\n ),\n // TODO: this doesn't make sense for all subcommands?\n scrambleAmount: optional(\n option(\"--scramble\", integer({ min: 0 }), {\n description: message`Scramble solved position.`,\n }),\n ),\n moveList: optional(\n map(\n option(\"--moves\", string({ metavar: \"COMMA_SEPARATED_MOVES\" }), {\n description: message`Restrict moves to this list. Example: \\\"U2,F,r\\\").`,\n }),\n (s) => s.split(\",\").map((m) => Move.fromString(m)),\n ),\n ),\n puzzle: map(\n argument(string({ metavar: \"PUZZLE\" }), {\n description: message`The puzzle can be given as a geometric description or by name.\nThe geometric description starts with one of:\n\n- \\`c\\` (cube),\\n\n- \\`t\\` (tetrahedron),\\n\n- \\`d\\` (dodecahedron),\\n\n- \\`i\\` (icosahedron),\\n\n- \\`o\\` (octahedron),\\n\n\nthen a space, then a series of cuts. Each cut begins with one of:\n\n- \\`f\\` (for a cut parallel to faces),\\n\n- \\`v\\` (for a cut perpendicular to a ray from the center through a corner),\\n\n- \\`e\\` (for a cut perpendicular to a ray from the center through an edge),\\n\n\nfollowed by a decimal number giving a distance, where 1 is the distance\nbetween the center of the puzzle and the center of a face.\n\nExample description: \\`c f 0 v 0.577350269189626 e 0\\`. Corresponds to: https://alpha.twizzle.net/explore/?puzzle=2x2x2+%2B+dino+%2B+little+chop\n\nThe recognized puzzle names are: ${Object.keys(puzzleList)\n .map((p) => JSON.stringify(p))\n .join(\", \")}`,\n }),\n (s) => {\n const parsed = parsePuzzleDescription(puzzleList[s] ?? s);\n if (parsed === null) {\n throw new Error(\"Could not parse puzzle description!\");\n }\n return parsed;\n },\n ),\n }),\n ),\n {\n programName: basename(argv[1]),\n description: message`\nExamples:\n\n puzzle-geometry --ss 2x2x2\\n\n puzzle-geometry --ss --fixcorner 2x2x2\\n\n puzzle-geometry --ss --moves U,F2,r 4x4x4\\n\n puzzle-geometry --ksolve --optimize --moves U,F,R megaminx\\n\n puzzle-geometry --gap --noedges megaminx\n`,\n help: \"option\",\n completion: {\n option: {\n names: [\"--completions\"],\n hidden: false,\n },\n },\n version: {\n option: {\n hidden: false,\n },\n value: packageVersion,\n },\n },\n);\n\nif (args.verbosity !== 0) {\n const cmd = () => {\n const [command, ...args] = argv;\n return new PrintableShellCommand(command, args).getPrintableCommand({\n argumentLineWrapping: \"inline\",\n });\n };\n\n switch (args.commentStyle) {\n case \"hash\": {\n console.log(`# ${cmd()}`);\n break;\n }\n case \"none\": {\n break;\n }\n case \"Pascal\": {\n console.log(`(* ${cmd()} *)`);\n break;\n }\n default:\n throw new Error(\"Invalid comment style.\") as never;\n }\n}\n\nfunction buildPuzzleGeometry(): PuzzleGeometry {\n const {\n verbosity,\n optimizeOrbits,\n addRotations,\n allMoves,\n outerBlockMoves,\n vertexMoves,\n includeCornerOrbits,\n includeCenterOrbits,\n includeEdgeOrbits,\n excludeOrbits,\n grayCorners,\n grayEdges,\n grayCenters,\n fixedOrientation,\n orientCenters,\n puzzleOrientation,\n puzzleOrientations,\n fixedPieceType,\n scrambleAmount,\n moveList,\n } = args;\n const options: ExperimentalPuzzleGeometryOptions = {\n verbosity,\n optimizeOrbits,\n addRotations,\n allMoves,\n outerBlockMoves,\n vertexMoves,\n includeCornerOrbits,\n includeCenterOrbits,\n includeEdgeOrbits,\n excludeOrbits,\n grayCorners,\n grayEdges,\n grayCenters,\n fixedOrientation,\n orientCenters,\n puzzleOrientation,\n puzzleOrientations,\n fixedPieceType,\n scrambleAmount,\n moveList,\n };\n\n const puzzleGeometry = new PuzzleGeometry(args.puzzle, options);\n // TODO: why are these calls needed?\n puzzleGeometry.allstickers();\n puzzleGeometry.genperms();\n return puzzleGeometry;\n}\n\nswitch (args.subcommand) {\n case \"KSolve\": {\n console.log(buildPuzzleGeometry().writeksolve());\n break;\n }\n case \"SVG\": {\n console.log(\n buildPuzzleGeometry().generatesvg(\n undefined,\n undefined,\n undefined,\n args.svg3D,\n ),\n );\n break;\n }\n case \"GAP\": {\n console.log(buildPuzzleGeometry().writegap());\n break;\n }\n case \"Mathematica\": {\n console.log(buildPuzzleGeometry().writemathematica());\n break;\n }\n case \"Schreier-Sims\": {\n buildPuzzleGeometry().writeSchreierSims(console.log);\n break;\n }\n case \"Canonical string analysis\": {\n buildPuzzleGeometry().showcanon(console.log);\n break;\n }\n case \"3D\": {\n console.log(JSON.stringify(buildPuzzleGeometry().get3d(), null, \" \"));\n break;\n }\n default:\n throw new Error(\"Invalid subcommand.\") as never;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;AA0BA,SAAS,gBAAgB;AACzB,SAAS,YAAY;AACrB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,WAAW;AACpB,SAAS,YAAY;AACrB;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,6BAA6B;AAGtC,IAAM,aAAa,oBAAoB;AAGvC,SAAS,SAAS,YAAwB,aAAsB;AAC9D,SAAO;AAAA,IACL;AAAA,MACE,KAAK,YAAY;AAAA,QACf;AAAA,MACF,CAAC;AAAA,MACD,CAAC,MAAM,CAAC;AAAA,IACV;AAAA,EACF;AACF;AAGA,IAAM,q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