@cubingcenter/scrambler 0.6.2 → 0.6.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"scrambler.d.ts","sourceRoot":"","sources":["../../../src/puzzles/cube4/scrambler.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAmJ9F,eAAO,MAAM,sBAAsB,EAAE,iBAYpC,CAAC;AAEF,wBAAsB,qBAAqB,CACzC,OAAO,GAAE,eAAe,GAAG;IAAE,cAAc,CAAC,EAAE,OAAO,CAAA;CAAO,GAC3D,OAAO,CAAC,cAAc,CAAC,CAyFzB"}
1
+ {"version":3,"file":"scrambler.d.ts","sourceRoot":"","sources":["../../../src/puzzles/cube4/scrambler.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAmJ9F,eAAO,MAAM,sBAAsB,EAAE,iBAYpC,CAAC;AAEF,wBAAsB,qBAAqB,CACzC,OAAO,GAAE,eAAe,GAAG;IAAE,cAAc,CAAC,EAAE,OAAO,CAAA;CAAO,GAC3D,OAAO,CAAC,cAAc,CAAC,CAiGzB"}
@@ -147,7 +147,17 @@ export const cube4ScrambleGenerator = {
147
147
  }
148
148
  };
149
149
  export async function generateCube4Scramble(options = {}) {
150
- const tables = await loadCube4Tables();
150
+ let tables;
151
+ try {
152
+ tables = await loadCube4Tables();
153
+ }
154
+ catch (error) {
155
+ console.warn("[cube4-scrambler] Failed to load reduction tables; using fallback.", error);
156
+ const cubingJsResult = await generateCube4WithCubingJs();
157
+ if (cubingJsResult)
158
+ return cubingJsResult;
159
+ return generateCube4RandomMoves(options);
160
+ }
151
161
  let lastError;
152
162
  // Retry with different states if the solver fails to find a physical
153
163
  // reduction (some random states are outside the solver's effective
@@ -184,7 +184,17 @@ exports.cube4ScrambleGenerator = {
184
184
  }
185
185
  };
186
186
  async function generateCube4Scramble(options = {}) {
187
- const tables = await loadCube4Tables();
187
+ let tables;
188
+ try {
189
+ tables = await loadCube4Tables();
190
+ }
191
+ catch (error) {
192
+ console.warn("[cube4-scrambler] Failed to load reduction tables; using fallback.", error);
193
+ const cubingJsResult = await generateCube4WithCubingJs();
194
+ if (cubingJsResult)
195
+ return cubingJsResult;
196
+ return generateCube4RandomMoves(options);
197
+ }
188
198
  let lastError;
189
199
  // Retry with different states if the solver fails to find a physical
190
200
  // reduction (some random states are outside the solver's effective
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cubingcenter/scrambler",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "description": "Extensible scramble generation toolkit for CubingCenter projects.",
5
5
  "type": "module",
6
6
  "license": "MIT",