cubing 0.61.0 → 0.61.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/chunks/chunk-ZQLNUW2N.js +14 -0
- package/dist/bin/chunks/chunk-ZQLNUW2N.js.map +7 -0
- package/dist/bin/order.js +46 -42
- package/dist/bin/order.js.map +2 -2
- package/dist/bin/puzzle-geometry-bin.js +379 -257
- package/dist/bin/puzzle-geometry-bin.js.map +3 -3
- package/dist/bin/scramble.js +124 -102
- package/dist/bin/scramble.js.map +3 -3
- package/dist/lib/cubing/{KPattern-CU9Suh1T.d.ts → PuzzleLoader-CkghxdIL.d.ts} +186 -179
- package/dist/lib/cubing/alg/index.d.ts +2 -2
- package/dist/lib/cubing/bluetooth/index.d.ts +3 -3
- package/dist/lib/cubing/bluetooth/index.js +4 -4
- package/dist/lib/cubing/{bluetooth-puzzle-gTRbIRyj.d.ts → bluetooth-puzzle-c-_IBAdu.d.ts} +1 -1
- package/dist/lib/cubing/chunks/{chunk-ABQAUY7H.js → chunk-557DMXD6.js} +3 -3
- package/dist/lib/cubing/chunks/{chunk-RKTO4CAU.js → chunk-7DT3G3FA.js} +2 -2
- package/dist/lib/cubing/chunks/{chunk-BUZPONAW.js → chunk-I5QO52OG.js} +2 -2
- package/dist/lib/cubing/chunks/{chunk-PVOSBZRD.js → chunk-KZGAQEPN.js} +3 -3
- package/dist/lib/cubing/chunks/{chunk-RUSWM2KK.js → chunk-ST4K23C3.js} +2 -2
- package/dist/lib/cubing/chunks/{chunk-RUSWM2KK.js.map → chunk-ST4K23C3.js.map} +1 -1
- package/dist/lib/cubing/chunks/{chunk-REBGU5ET.js → chunk-T3SF7NHB.js} +2 -2
- package/dist/lib/cubing/chunks/{chunk-OJI4YUWF.js → chunk-UMNYMJKD.js} +4 -4
- package/dist/lib/cubing/chunks/{chunk-WIZJQ7QS.js → chunk-UZ7SWKN6.js} +15 -15
- package/dist/lib/cubing/chunks/{chunk-PSQEELP4.js → chunk-WAYEJXCG.js} +1 -1
- package/dist/lib/cubing/chunks/chunk-WAYEJXCG.js.map +7 -0
- package/dist/lib/cubing/chunks/{chunk-NX2Q6B7Y.js → chunk-ZKJKRQKY.js} +2 -2
- package/dist/lib/cubing/chunks/{chunk-NX2Q6B7Y.js.map → chunk-ZKJKRQKY.js.map} +2 -2
- package/dist/lib/cubing/chunks/{inside-PM6546BQ.js → inside-K3VX2AIZ.js} +12 -12
- package/dist/lib/cubing/chunks/{puzzles-dynamic-side-events-BOGUHF4Q.js → puzzles-dynamic-side-events-IMYJ533P.js} +1 -1
- package/dist/lib/cubing/chunks/puzzles-dynamic-side-events-IMYJ533P.js.map +7 -0
- package/dist/lib/cubing/chunks/{search-dynamic-sgs-side-events-SYC27DSG.js → search-dynamic-sgs-side-events-RIRYKEP5.js} +4 -4
- package/dist/lib/cubing/chunks/{search-dynamic-sgs-unofficial-QGGV4PCJ.js → search-dynamic-sgs-unofficial-N4CRUF4Q.js} +4 -4
- package/dist/lib/cubing/chunks/{search-dynamic-solve-4x4x4-IE5W637Q.js → search-dynamic-solve-4x4x4-4UB4NMF3.js} +7 -7
- package/dist/lib/cubing/chunks/search-worker-entry.js +3 -3
- package/dist/lib/cubing/chunks/{twisty-dynamic-3d-LPZQIDD2.js → twisty-dynamic-3d-OCL53BVF.js} +5 -5
- package/dist/lib/cubing/{index-CORXpckt.d.ts → index-B_8W-2zR.d.ts} +1 -1
- package/dist/lib/cubing/kpuzzle/index.d.ts +1 -1
- package/dist/lib/cubing/kpuzzle/index.js +1 -1
- package/dist/lib/cubing/notation/index.d.ts +1 -1
- package/dist/lib/cubing/notation/index.js +3 -3
- package/dist/lib/cubing/protocol/index.d.ts +1 -1
- package/dist/lib/cubing/protocol/index.js +3 -3
- package/dist/lib/cubing/puzzle-geometry/index.d.ts +2 -2
- package/dist/lib/cubing/puzzle-geometry/index.js +138 -179
- package/dist/lib/cubing/puzzle-geometry/index.js.map +3 -3
- package/dist/lib/cubing/puzzles/index.d.ts +1 -1
- package/dist/lib/cubing/puzzles/index.js +3 -3
- package/dist/lib/cubing/scramble/index.d.ts +2 -2
- package/dist/lib/cubing/scramble/index.js +6 -6
- package/dist/lib/cubing/search/index.d.ts +3 -3
- package/dist/lib/cubing/search/index.js +6 -6
- package/dist/lib/cubing/stream/index.d.ts +2 -2
- package/dist/lib/cubing/twisty/index.d.ts +2 -2
- package/dist/lib/cubing/twisty/index.js +5 -5
- package/dist/lib/cubing/twisty/index.js.map +1 -1
- package/experimental-json-schema/kpuzzle/KPatternData.schema.json +22 -30
- package/experimental-json-schema/kpuzzle/KPuzzleDefinition.schema.json +72 -89
- package/experimental-json-schema/kpuzzle/KTransformationData.schema.json +17 -26
- package/package.json +54 -100
- package/dist/bin/chunks/chunk-J53ID3VX.js +0 -26
- package/dist/bin/chunks/chunk-J53ID3VX.js.map +0 -7
- package/dist/lib/cubing/chunks/chunk-PSQEELP4.js.map +0 -7
- package/dist/lib/cubing/chunks/puzzles-dynamic-side-events-BOGUHF4Q.js.map +0 -7
- /package/dist/lib/cubing/chunks/{chunk-ABQAUY7H.js.map → chunk-557DMXD6.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{chunk-RKTO4CAU.js.map → chunk-7DT3G3FA.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{chunk-BUZPONAW.js.map → chunk-I5QO52OG.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{chunk-PVOSBZRD.js.map → chunk-KZGAQEPN.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{chunk-REBGU5ET.js.map → chunk-T3SF7NHB.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{chunk-OJI4YUWF.js.map → chunk-UMNYMJKD.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{chunk-WIZJQ7QS.js.map → chunk-UZ7SWKN6.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{inside-PM6546BQ.js.map → inside-K3VX2AIZ.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{search-dynamic-sgs-side-events-SYC27DSG.js.map → search-dynamic-sgs-side-events-RIRYKEP5.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{search-dynamic-sgs-unofficial-QGGV4PCJ.js.map → search-dynamic-sgs-unofficial-N4CRUF4Q.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{search-dynamic-solve-4x4x4-IE5W637Q.js.map → search-dynamic-solve-4x4x4-4UB4NMF3.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{twisty-dynamic-3d-LPZQIDD2.js.map → twisty-dynamic-3d-OCL53BVF.js.map} +0 -0
|
@@ -357,10 +357,6 @@ interface NotationMapper {
|
|
|
357
357
|
notationToExternal(move: Move): Move | null;
|
|
358
358
|
}
|
|
359
359
|
|
|
360
|
-
declare function parseOptions(argv: string[]): {
|
|
361
|
-
puzzleDescription: PuzzleDescription | null;
|
|
362
|
-
options: PuzzleGeometryOptions;
|
|
363
|
-
};
|
|
364
360
|
type FaceName = string;
|
|
365
361
|
type OrientationDirection = [number, number, number];
|
|
366
362
|
type FaceBasedOrientationDescription = [
|
|
@@ -381,7 +377,7 @@ declare class PuzzleGeometryFullOptions {
|
|
|
381
377
|
outerBlockMoves: boolean;
|
|
382
378
|
vertexMoves: boolean;
|
|
383
379
|
addRotations: boolean;
|
|
384
|
-
moveList: string[] | null;
|
|
380
|
+
moveList: (string | Move)[] | null;
|
|
385
381
|
fixedOrientation: boolean;
|
|
386
382
|
fixedPieceType: null | "e" | "v" | "f";
|
|
387
383
|
orientCenters: boolean;
|
|
@@ -414,157 +410,6 @@ declare class Perm {
|
|
|
414
410
|
order(): number;
|
|
415
411
|
}
|
|
416
412
|
|
|
417
|
-
type KPatternData = Record<string, KPatternOrbitData>;
|
|
418
|
-
interface KPatternOrbitData {
|
|
419
|
-
pieces: number[];
|
|
420
|
-
orientation: number[];
|
|
421
|
-
/** Each piece may have an "orientation mod" that means "the orientation of
|
|
422
|
-
* this piece is known mod [value]".
|
|
423
|
-
*
|
|
424
|
-
* Suppose `.numOrientations` for this orbit has a value of N. This is
|
|
425
|
-
* considered the default value for the orientation mod of each piece in the
|
|
426
|
-
* orbit.
|
|
427
|
-
*
|
|
428
|
-
* - Each entry must be one of the following:
|
|
429
|
-
* - A proper divisor of N.
|
|
430
|
-
* - For example: if N is 12, then one of: 1, 2, 3, 6
|
|
431
|
-
* - The special value 0, indicating the default value (N).
|
|
432
|
-
* - This indicates that the orientation of a piece is fully known, i.e.
|
|
433
|
-
* that its "orientation mod" is the default value (N). However, such a
|
|
434
|
-
* value is recorded as 0 instead of N, in order to make it simpler to
|
|
435
|
-
* implement and debug pattern logic involving the default value.
|
|
436
|
-
* - If `.orientationMod[i]` is a proper divisor of N (i.e. not 0), then
|
|
437
|
-
* `.orientation[i]` must be less than `.orientationMod[i]`. That is, the
|
|
438
|
-
* orientation values must be individually "normalized" for each piece.
|
|
439
|
-
* - If the `orientationMod` field is not present, then every piece is
|
|
440
|
-
* considered to have the default value for its "orientation mod".
|
|
441
|
-
*
|
|
442
|
-
* For a "real-world" example of this concept, consider a traditional analog
|
|
443
|
-
* 12-hour clock dial, like one that might hang on the wall in a school room.
|
|
444
|
-
* Although there are 24 hours in a day, A.M. and P.M. times are not
|
|
445
|
-
* distinguishable on such a clock. Since 3:00 (AM) and 15:00 are not
|
|
446
|
-
* distinguishable, we would read either of those times as 3:00 with an
|
|
447
|
-
* implicit "orientation mod" of 12.
|
|
448
|
-
*
|
|
449
|
-
* For most puzzles, however, we care about "visual" indistinguishability
|
|
450
|
-
* rather than "temporal" indistinguishability. To adapt the previous example,
|
|
451
|
-
* imagine a 24-hour clock with 24 hour marks around the dial, but where the
|
|
452
|
-
* hour hand is symmetric and points equally at the current hour as well as
|
|
453
|
-
* its diametic opposite (like a compass needle but painted all in one color).
|
|
454
|
-
* This has the same set of "valid patterns" as a normal 12-hour clock. Such a
|
|
455
|
-
* clock also has an "orientation mod" of 12, but where the multiples of the
|
|
456
|
-
* modulus have been "unfolded" to show their full symmetry instead of being
|
|
457
|
-
* implicit.
|
|
458
|
-
*
|
|
459
|
-
* For a non-trivial puzzle example, consider Eitan's FisherTwist, a shape mod
|
|
460
|
-
* of the 3x3x3 cube:
|
|
461
|
-
* https://www.hknowstore.com/locale/en-US/item.aspx?corpname=nowstore&itemid=97eb4e89-367e-4d02-b7f0-34e5e7f3cd12
|
|
462
|
-
*
|
|
463
|
-
* - The 4 equatorial centers have C₂ symmetry — it is possible to rotate any
|
|
464
|
-
* of these centers 180° without a visible change to the state. This means
|
|
465
|
-
* that the possible orientations "loop" after incrementing the orientation
|
|
466
|
-
* by 2 (two turns clockwise), and therefore the "orientation mod" of a
|
|
467
|
-
* given piece is only 2.
|
|
468
|
-
* - If we apply a counter-clockwise rotation to one of these centers, the
|
|
469
|
-
* transformation applies an orientation of 3. But the net orientation is
|
|
470
|
-
* recorded as a normalized value of 1 instead, because 3 (mod 2) ≡ 1 (mod
|
|
471
|
-
* 2).
|
|
472
|
-
* - The 2 polar centers (U and D) have no distinguishable rotations. This
|
|
473
|
-
* means that their orientation is "known mod 1" — any transformation of one
|
|
474
|
-
* of these centers is indistinguishable from another transformation of the
|
|
475
|
-
* same center, and all of them are mapped to a value of 0 (the only
|
|
476
|
-
* possible value that exists mod 1).
|
|
477
|
-
*
|
|
478
|
-
* For 3x3x3:
|
|
479
|
-
*
|
|
480
|
-
* - When solving a normal 3x3x3, center orientations are conventionally
|
|
481
|
-
* ignored. This is similar to the polar center case for Eitan's
|
|
482
|
-
* FisherTwist, and the "orientation mod" of each piece is 1. This is also
|
|
483
|
-
* the core motivating use case.
|
|
484
|
-
* - For a supercube
|
|
485
|
-
* (https://experiments.cubing.net/cubing.js/twisty/supercube.html) or the
|
|
486
|
-
* general case of a "picture cube", all four center orientations are
|
|
487
|
-
* distinguishable for every center. This means all centers have the default
|
|
488
|
-
* orientation mod of 4. As documented above, this can be recorded with a
|
|
489
|
-
* `.orientationMod` of `[0, 0, 0, 0, 0, 0]`, or equivalently by omitting
|
|
490
|
-
* the `.orientationMod` field.
|
|
491
|
-
* - When modeling a real 3x3x3 speedcube, it is common to have a logo on a
|
|
492
|
-
* single sticker. If you want to model the exact visually distinguishable
|
|
493
|
-
* states of such a puzzles, it is possible to use an `.orientationMod` such
|
|
494
|
-
* as `[0, 1, 1, 1, 1, 1]`. For example, this can make it easy to find an
|
|
495
|
-
* alg for a given case "while keeping the logo the same", without placing
|
|
496
|
-
* more restrictions on other centers (which could make the search slower or
|
|
497
|
-
* produce longer solutions).
|
|
498
|
-
*
|
|
499
|
-
* For those with a mathematical background, you may notice a relationship to
|
|
500
|
-
* the concept of a coset (https://en.wikipedia.org/wiki/Coset). For example,
|
|
501
|
-
* consider the group of patterns of a `KPuzzle` (without indistinguishable
|
|
502
|
-
* pieces) generated by a set of transformations. We can assign each set of
|
|
503
|
-
* piece orbits an orientation mod value (which must be identical for all
|
|
504
|
-
* constituent pieces of the same orbit). Each such choice generates a set of
|
|
505
|
-
* valid `KPattern`s that forms a subgroup, and each set of valid `.orientation`
|
|
506
|
-
* values defines one coset of this set. However, note that the set of valid
|
|
507
|
-
* `KPattern`s does *not* form a group when there are any pieces with different
|
|
508
|
-
* `.orientationMod` values that share an orbit.
|
|
509
|
-
*
|
|
510
|
-
* --------
|
|
511
|
-
*
|
|
512
|
-
* Note that the concept of "orientation mod" exclusively applies to `KPattern`,
|
|
513
|
-
* not `KTransformation`. If we tried to apply the orientation mod
|
|
514
|
-
* calculations to the *transformations* of Eitan's FisherTwist, then `SWAP =
|
|
515
|
-
* [U, M' E2 M]` would be indistinguishable from the identity. This would mean
|
|
516
|
-
* that if we calculated `SWAP` and then used this calculation for `S SWAP
|
|
517
|
-
* S'`, then we would conclude that it has no net effect. However, `S SWAP S'`
|
|
518
|
-
* does *not* have the same effect as doing nothing — it visibly rotates the L
|
|
519
|
-
* and R centers! (In mathematical terms: the set of `KTransformation`s would
|
|
520
|
-
* not form a valid set of semigroup actions, due to broken associativity.)
|
|
521
|
-
*
|
|
522
|
-
* Although there are times that we could theoretically save some time/space
|
|
523
|
-
* by ignoring some information when it's not needed for working with certain
|
|
524
|
-
* `KTransformation`s (e.g. ignoring all center orientations for 3x3x3), it is
|
|
525
|
-
* more practical for each `KTransformation` to always track the full range
|
|
526
|
-
* for each piece's `.orientation`. For example:
|
|
527
|
-
*
|
|
528
|
-
* - This is simpler, both conceptually and in code.
|
|
529
|
-
* - This allows changing the set of moves for a puzzle, without recalculating
|
|
530
|
-
* cached transformations or certain lookup tables (useful for alg
|
|
531
|
-
* searches).
|
|
532
|
-
* - This allows swapping out a normal 3x3x3 in a `<twisty-player>` for a
|
|
533
|
-
* picture cube, without re-calculating the center orientations of the
|
|
534
|
-
* current alg.
|
|
535
|
-
*
|
|
536
|
-
* These use cases may not be strictly "necessary", but the opposite behaviour
|
|
537
|
-
* might be surprising or frustrating if someone does not expect it. So we
|
|
538
|
-
* implement it this way.
|
|
539
|
-
*
|
|
540
|
-
* Informally, the `KTransformation` has the full responsibility for tracking
|
|
541
|
-
* "what really happens" — even if the effect is invisible in some cases,
|
|
542
|
-
* while the `KPattern` tracks both what "is" and what "isn't" known.
|
|
543
|
-
**/
|
|
544
|
-
orientationMod?: number[];
|
|
545
|
-
}
|
|
546
|
-
type KTransformationData = Record<string, KTransformationOrbitData>;
|
|
547
|
-
interface KTransformationOrbitData {
|
|
548
|
-
permutation: number[];
|
|
549
|
-
orientationDelta: number[];
|
|
550
|
-
}
|
|
551
|
-
interface KPuzzleOrbitDefinition {
|
|
552
|
-
orbitName: string;
|
|
553
|
-
numPieces: number;
|
|
554
|
-
numOrientations: number;
|
|
555
|
-
}
|
|
556
|
-
interface KPuzzleDefinition {
|
|
557
|
-
name: string;
|
|
558
|
-
orbits: KPuzzleOrbitDefinition[];
|
|
559
|
-
defaultPattern: KPatternData;
|
|
560
|
-
moves: Record<string, KTransformationData>;
|
|
561
|
-
derivedMoves?: Record<string, string>;
|
|
562
|
-
experimentalIsPatternSolved?: (kpattern: KPattern, options: {
|
|
563
|
-
ignorePuzzleOrientation: boolean;
|
|
564
|
-
ignoreCenterOrientation: boolean;
|
|
565
|
-
}) => boolean;
|
|
566
|
-
}
|
|
567
|
-
|
|
568
413
|
declare class PGOrbitDef {
|
|
569
414
|
size: number;
|
|
570
415
|
mod: number;
|
|
@@ -635,10 +480,10 @@ declare class VisibleState extends PGTransformBase {
|
|
|
635
480
|
}
|
|
636
481
|
|
|
637
482
|
type PuzzleDescriptionString = string;
|
|
638
|
-
declare const
|
|
483
|
+
declare const pgPuzzle: {
|
|
639
484
|
[name: string]: PuzzleDescriptionString;
|
|
640
485
|
};
|
|
641
|
-
type PuzzleName = keyof typeof
|
|
486
|
+
type PuzzleName = keyof typeof pgPuzzle;
|
|
642
487
|
|
|
643
488
|
declare class Quat {
|
|
644
489
|
a: number;
|
|
@@ -839,6 +684,168 @@ declare class PGNotation {
|
|
|
839
684
|
remapKPuzzleDefinition(kpuzzleDefinition: KPuzzleDefinition): KPuzzleDefinition;
|
|
840
685
|
}
|
|
841
686
|
|
|
687
|
+
type KPatternData = {
|
|
688
|
+
[orbitName: string]: KPatternOrbitData;
|
|
689
|
+
};
|
|
690
|
+
interface KPatternOrbitData {
|
|
691
|
+
pieces: number[];
|
|
692
|
+
orientation: number[];
|
|
693
|
+
/** Each piece may have an "orientation mod" that means "the orientation of
|
|
694
|
+
* this piece is known mod [value]".
|
|
695
|
+
*
|
|
696
|
+
* Suppose `.numOrientations` for this orbit has a value of N. This is
|
|
697
|
+
* considered the default value for the orientation mod of each piece in the
|
|
698
|
+
* orbit.
|
|
699
|
+
*
|
|
700
|
+
* - Each entry must be one of the following:
|
|
701
|
+
* - A proper divisor of N.
|
|
702
|
+
* - For example: if N is 12, then one of: 1, 2, 3, 6
|
|
703
|
+
* - The special value 0, indicating the default value (N).
|
|
704
|
+
* - This indicates that the orientation of a piece is fully known, i.e.
|
|
705
|
+
* that its "orientation mod" is the default value (N). However, such a
|
|
706
|
+
* value is recorded as 0 instead of N, in order to make it simpler to
|
|
707
|
+
* implement and debug pattern logic involving the default value.
|
|
708
|
+
* - If `.orientationMod[i]` is a proper divisor of N (i.e. not 0), then
|
|
709
|
+
* `.orientation[i]` must be less than `.orientationMod[i]`. That is, the
|
|
710
|
+
* orientation values must be individually "normalized" for each piece.
|
|
711
|
+
* - If the `orientationMod` field is not present, then every piece is
|
|
712
|
+
* considered to have the default value for its "orientation mod".
|
|
713
|
+
*
|
|
714
|
+
* For a "real-world" example of this concept, consider a traditional analog
|
|
715
|
+
* 12-hour clock dial, like one that might hang on the wall in a school room.
|
|
716
|
+
* Although there are 24 hours in a day, A.M. and P.M. times are not
|
|
717
|
+
* distinguishable on such a clock. Since 3:00 (AM) and 15:00 are not
|
|
718
|
+
* distinguishable, we would read either of those times as 3:00 with an
|
|
719
|
+
* implicit "orientation mod" of 12.
|
|
720
|
+
*
|
|
721
|
+
* For most puzzles, however, we care about "visual" indistinguishability
|
|
722
|
+
* rather than "temporal" indistinguishability. To adapt the previous example,
|
|
723
|
+
* imagine a 24-hour clock with 24 hour marks around the dial, but where the
|
|
724
|
+
* hour hand is symmetric and points equally at the current hour as well as
|
|
725
|
+
* its diametic opposite (like a compass needle but painted all in one color).
|
|
726
|
+
* This has the same set of "valid patterns" as a normal 12-hour clock. Such a
|
|
727
|
+
* clock also has an "orientation mod" of 12, but where the multiples of the
|
|
728
|
+
* modulus have been "unfolded" to show their full symmetry instead of being
|
|
729
|
+
* implicit.
|
|
730
|
+
*
|
|
731
|
+
* For a non-trivial puzzle example, consider Eitan's FisherTwist, a shape mod
|
|
732
|
+
* of the 3x3x3 cube:
|
|
733
|
+
* https://www.hknowstore.com/locale/en-US/item.aspx?corpname=nowstore&itemid=97eb4e89-367e-4d02-b7f0-34e5e7f3cd12
|
|
734
|
+
*
|
|
735
|
+
* - The 4 equatorial centers have C₂ symmetry — it is possible to rotate any
|
|
736
|
+
* of these centers 180° without a visible change to the state. This means
|
|
737
|
+
* that the possible orientations "loop" after incrementing the orientation
|
|
738
|
+
* by 2 (two turns clockwise), and therefore the "orientation mod" of a
|
|
739
|
+
* given piece is only 2.
|
|
740
|
+
* - If we apply a counter-clockwise rotation to one of these centers, the
|
|
741
|
+
* transformation applies an orientation of 3. But the net orientation is
|
|
742
|
+
* recorded as a normalized value of 1 instead, because 3 (mod 2) ≡ 1 (mod
|
|
743
|
+
* 2).
|
|
744
|
+
* - The 2 polar centers (U and D) have no distinguishable rotations. This
|
|
745
|
+
* means that their orientation is "known mod 1" — any transformation of one
|
|
746
|
+
* of these centers is indistinguishable from another transformation of the
|
|
747
|
+
* same center, and all of them are mapped to a value of 0 (the only
|
|
748
|
+
* possible value that exists mod 1).
|
|
749
|
+
*
|
|
750
|
+
* For 3x3x3:
|
|
751
|
+
*
|
|
752
|
+
* - When solving a normal 3x3x3, center orientations are conventionally
|
|
753
|
+
* ignored. This is similar to the polar center case for Eitan's
|
|
754
|
+
* FisherTwist, and the "orientation mod" of each piece is 1. This is also
|
|
755
|
+
* the core motivating use case.
|
|
756
|
+
* - For a supercube
|
|
757
|
+
* (https://experiments.cubing.net/cubing.js/twisty/supercube.html) or the
|
|
758
|
+
* general case of a "picture cube", all four center orientations are
|
|
759
|
+
* distinguishable for every center. This means all centers have the default
|
|
760
|
+
* orientation mod of 4. As documented above, this can be recorded with a
|
|
761
|
+
* `.orientationMod` of `[0, 0, 0, 0, 0, 0]`, or equivalently by omitting
|
|
762
|
+
* the `.orientationMod` field.
|
|
763
|
+
* - When modeling a real 3x3x3 speedcube, it is common to have a logo on a
|
|
764
|
+
* single sticker. If you want to model the exact visually distinguishable
|
|
765
|
+
* states of such a puzzles, it is possible to use an `.orientationMod` such
|
|
766
|
+
* as `[0, 1, 1, 1, 1, 1]`. For example, this can make it easy to find an
|
|
767
|
+
* alg for a given case "while keeping the logo the same", without placing
|
|
768
|
+
* more restrictions on other centers (which could make the search slower or
|
|
769
|
+
* produce longer solutions).
|
|
770
|
+
*
|
|
771
|
+
* For those with a mathematical background, you may notice a relationship to
|
|
772
|
+
* the concept of a coset (https://en.wikipedia.org/wiki/Coset). For example,
|
|
773
|
+
* consider the group of patterns of a `KPuzzle` (without indistinguishable
|
|
774
|
+
* pieces) generated by a set of transformations. We can assign each set of
|
|
775
|
+
* piece orbits an orientation mod value (which must be identical for all
|
|
776
|
+
* constituent pieces of the same orbit). Each such choice generates a set of
|
|
777
|
+
* valid `KPattern`s that forms a subgroup, and each set of valid `.orientation`
|
|
778
|
+
* values defines one coset of this set. However, note that the set of valid
|
|
779
|
+
* `KPattern`s does *not* form a group when there are any pieces with different
|
|
780
|
+
* `.orientationMod` values that share an orbit.
|
|
781
|
+
*
|
|
782
|
+
* --------
|
|
783
|
+
*
|
|
784
|
+
* Note that the concept of "orientation mod" exclusively applies to `KPattern`,
|
|
785
|
+
* not `KTransformation`. If we tried to apply the orientation mod
|
|
786
|
+
* calculations to the *transformations* of Eitan's FisherTwist, then `SWAP =
|
|
787
|
+
* [U, M' E2 M]` would be indistinguishable from the identity. This would mean
|
|
788
|
+
* that if we calculated `SWAP` and then used this calculation for `S SWAP
|
|
789
|
+
* S'`, then we would conclude that it has no net effect. However, `S SWAP S'`
|
|
790
|
+
* does *not* have the same effect as doing nothing — it visibly rotates the L
|
|
791
|
+
* and R centers! (In mathematical terms: the set of `KTransformation`s would
|
|
792
|
+
* not form a valid set of semigroup actions, due to broken associativity.)
|
|
793
|
+
*
|
|
794
|
+
* Although there are times that we could theoretically save some time/space
|
|
795
|
+
* by ignoring some information when it's not needed for working with certain
|
|
796
|
+
* `KTransformation`s (e.g. ignoring all center orientations for 3x3x3), it is
|
|
797
|
+
* more practical for each `KTransformation` to always track the full range
|
|
798
|
+
* for each piece's `.orientation`. For example:
|
|
799
|
+
*
|
|
800
|
+
* - This is simpler, both conceptually and in code.
|
|
801
|
+
* - This allows changing the set of moves for a puzzle, without recalculating
|
|
802
|
+
* cached transformations or certain lookup tables (useful for alg
|
|
803
|
+
* searches).
|
|
804
|
+
* - This allows swapping out a normal 3x3x3 in a `<twisty-player>` for a
|
|
805
|
+
* picture cube, without re-calculating the center orientations of the
|
|
806
|
+
* current alg.
|
|
807
|
+
*
|
|
808
|
+
* These use cases may not be strictly "necessary", but the opposite behaviour
|
|
809
|
+
* might be surprising or frustrating if someone does not expect it. So we
|
|
810
|
+
* implement it this way.
|
|
811
|
+
*
|
|
812
|
+
* Informally, the `KTransformation` has the full responsibility for tracking
|
|
813
|
+
* "what really happens" — even if the effect is invisible in some cases,
|
|
814
|
+
* while the `KPattern` tracks both what "is" and what "isn't" known.
|
|
815
|
+
**/
|
|
816
|
+
orientationMod?: number[];
|
|
817
|
+
}
|
|
818
|
+
type KTransformationData = {
|
|
819
|
+
[orbitName: string]: KTransformationOrbitData;
|
|
820
|
+
};
|
|
821
|
+
interface KTransformationOrbitData {
|
|
822
|
+
permutation: number[];
|
|
823
|
+
orientationDelta: number[];
|
|
824
|
+
}
|
|
825
|
+
interface KPuzzleOrbitDefinition {
|
|
826
|
+
orbitName: string;
|
|
827
|
+
numPieces: number;
|
|
828
|
+
numOrientations: number;
|
|
829
|
+
}
|
|
830
|
+
interface KPuzzleDefinitionJSON {
|
|
831
|
+
name: string;
|
|
832
|
+
orbits: KPuzzleOrbitDefinition[];
|
|
833
|
+
defaultPattern: KPatternData;
|
|
834
|
+
moves: {
|
|
835
|
+
[orbitName: string]: KTransformationData;
|
|
836
|
+
};
|
|
837
|
+
derivedMoves?: {
|
|
838
|
+
[derivedMove: string]: string;
|
|
839
|
+
};
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
interface KPuzzleDefinition extends KPuzzleDefinitionJSON {
|
|
843
|
+
experimentalIsPatternSolved?: (kpattern: KPattern, options: {
|
|
844
|
+
ignorePuzzleOrientation: boolean;
|
|
845
|
+
ignoreCenterOrientation: boolean;
|
|
846
|
+
}) => boolean;
|
|
847
|
+
}
|
|
848
|
+
|
|
842
849
|
declare class KTransformation {
|
|
843
850
|
#private;
|
|
844
851
|
readonly kpuzzle: KPuzzle;
|
|
@@ -879,6 +886,26 @@ declare class KPuzzle {
|
|
|
879
886
|
canConvertDefaultPatternToUniqueTransformation(): boolean;
|
|
880
887
|
}
|
|
881
888
|
|
|
889
|
+
declare class KPattern {
|
|
890
|
+
readonly kpuzzle: KPuzzle;
|
|
891
|
+
readonly patternData: KPatternData;
|
|
892
|
+
constructor(kpuzzle: KPuzzle, patternData: KPatternData);
|
|
893
|
+
toJSON(): any;
|
|
894
|
+
static fromTransformation(transformation: KTransformation): KPattern;
|
|
895
|
+
/** @deprecated */
|
|
896
|
+
apply(source: KTransformationSource): KPattern;
|
|
897
|
+
applyTransformation(transformation: KTransformation): KPattern;
|
|
898
|
+
applyMove(move: Move | string): KPattern;
|
|
899
|
+
applyAlg(alg: Alg | string): KPattern;
|
|
900
|
+
isIdentical(other: KPattern): boolean;
|
|
901
|
+
/** @deprecated */
|
|
902
|
+
experimentalToTransformation(): KTransformation | null;
|
|
903
|
+
experimentalIsSolved(options: {
|
|
904
|
+
ignorePuzzleOrientation: boolean;
|
|
905
|
+
ignoreCenterOrientation: boolean;
|
|
906
|
+
}): boolean;
|
|
907
|
+
}
|
|
908
|
+
|
|
882
909
|
type MillisecondTimestamp = Tagged<DOMHighResTimeStamp, "MillisecondTimestamp">;
|
|
883
910
|
type MillisecondDuration = Tagged<number, "MillisecondDuration">;
|
|
884
911
|
declare enum Direction {
|
|
@@ -2322,24 +2349,4 @@ interface PuzzleLoader {
|
|
|
2322
2349
|
algTransformData?: AlgTransformData;
|
|
2323
2350
|
}
|
|
2324
2351
|
|
|
2325
|
-
|
|
2326
|
-
readonly kpuzzle: KPuzzle;
|
|
2327
|
-
readonly patternData: KPatternData;
|
|
2328
|
-
constructor(kpuzzle: KPuzzle, patternData: KPatternData);
|
|
2329
|
-
toJSON(): any;
|
|
2330
|
-
static fromTransformation(transformation: KTransformation): KPattern;
|
|
2331
|
-
/** @deprecated */
|
|
2332
|
-
apply(source: KTransformationSource): KPattern;
|
|
2333
|
-
applyTransformation(transformation: KTransformation): KPattern;
|
|
2334
|
-
applyMove(move: Move | string): KPattern;
|
|
2335
|
-
applyAlg(alg: Alg | string): KPattern;
|
|
2336
|
-
isIdentical(other: KPattern): boolean;
|
|
2337
|
-
/** @deprecated */
|
|
2338
|
-
experimentalToTransformation(): KTransformation | null;
|
|
2339
|
-
experimentalIsSolved(options: {
|
|
2340
|
-
ignorePuzzleOrientation: boolean;
|
|
2341
|
-
ignoreCenterOrientation: boolean;
|
|
2342
|
-
}): boolean;
|
|
2343
|
-
}
|
|
2344
|
-
|
|
2345
|
-
export { Newline as $, type AlgLeaf as A, type MillisecondTimestamp as B, type LeafIndex as C, KTransformation as D, type ExperimentalStickering as E, type MillisecondDuration as F, type BackViewLayout as G, backViewLayouts as H, TwistyAlgViewer as I, type TwistyPlayerConfig as J, KPattern as K, type LeafCount as L, Move as M, NO_VALUE as N, TwistyPlayer as O, Perm as P, Quat as Q, TwizzleLink as R, type StickerDat as S, TwistyAlgEditor as T, type AlgNode as U, type VisualizationFormat as V, type AppendOptions as W, Grouping as X, LineComment as Y, Commutator as Z, Conjugate as _, type PuzzleGeometryOptions as a, Pause as a0, type KeyMapping as a1, type AlgBranch as a2, type GroupingModifications as a3, type MoveModifications as a4, type Parsed as a5, type ExperimentalNotationType as a6, type ExperimentalSerializationOptions as a7, type AppendCancelOptions as a8, type SimplifyOptions as a9, QuantumMove as aa, type KPatternData as ab, type KPatternOrbitData as ac, type KPuzzleDefinition as ad, type KTransformationData as ae, type KTransformationOrbitData as af, type StickerDatAxis as b, type StickerDatFace as c, type StickerDatSticker as d, getPuzzleDescriptionString as e, getPuzzleGeometryByDesc as f, getPG3DNamedPuzzles as g, getPuzzleGeometryByName as h, PGNotation as i, PUZZLE_BASE_SHAPES as j, PUZZLE_CUT_TYPES as k, type PuzzleBaseShape as l, type PuzzleCutDescription as m, type PuzzleCutType as n, type PuzzleDescription as o, parseOptions as p, PuzzleGeometry as q, parsePuzzleDescription as r, Alg as s, type PuzzleLoader as t, type PuzzleID as u, KPuzzle as v, type StickeringMask as w, type PuzzleSpecificSimplifyOptions as x, type AlgTransformData as y, type AlgIndexer as z };
|
|
2352
|
+
export { Pause as $, type AlgLeaf as A, type LeafIndex as B, KTransformation as C, type MillisecondDuration as D, type ExperimentalStickering as E, type BackViewLayout as F, backViewLayouts as G, TwistyAlgViewer as H, type TwistyPlayerConfig as I, TwistyPlayer as J, KPattern as K, type LeafCount as L, Move as M, NO_VALUE as N, TwizzleLink as O, Perm as P, Quat as Q, type AlgNode as R, type StickerDat as S, TwistyAlgEditor as T, type AppendOptions as U, type VisualizationFormat as V, Grouping as W, LineComment as X, Commutator as Y, Conjugate as Z, Newline as _, type PuzzleGeometryOptions as a, type KeyMapping as a0, type AlgBranch as a1, type GroupingModifications as a2, type MoveModifications as a3, type Parsed as a4, type ExperimentalNotationType as a5, type ExperimentalSerializationOptions as a6, type AppendCancelOptions as a7, type SimplifyOptions as a8, QuantumMove as a9, type KPuzzleDefinition as aa, type KPatternData as ab, type KPatternOrbitData as ac, type KPuzzleOrbitDefinition as ad, type KTransformationData as ae, type KTransformationOrbitData as af, type StickerDatAxis as b, type StickerDatFace as c, type StickerDatSticker as d, getPuzzleDescriptionString as e, getPuzzleGeometryByDesc as f, getPG3DNamedPuzzles as g, getPuzzleGeometryByName as h, PGNotation as i, PUZZLE_BASE_SHAPES as j, PUZZLE_CUT_TYPES as k, type PuzzleBaseShape as l, type PuzzleCutDescription as m, type PuzzleCutType as n, type PuzzleDescription as o, PuzzleGeometry as p, parsePuzzleDescription as q, Alg as r, type PuzzleLoader as s, type PuzzleID as t, KPuzzle as u, type StickeringMask as v, type PuzzleSpecificSimplifyOptions as w, type AlgTransformData as x, type AlgIndexer as y, type MillisecondTimestamp as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { R as AlgNode, r as Alg, M as Move, U as AppendOptions, W as Grouping, X as LineComment, Y as Commutator, Z as Conjugate, _ as Newline, $ as Pause, a0 as KeyMapping, A as AlgLeaf } from '../PuzzleLoader-CkghxdIL.js';
|
|
2
|
+
export { a1 as AlgBranch, a7 as AppendCancelOptions, a5 as ExperimentalNotationType, a4 as ExperimentalParsed, a6 as ExperimentalSerializationOptions, a2 as GroupingModifications, a3 as MoveModifications, w as PuzzleSpecificSimplifyOptions, a9 as QuantumMove, a8 as SimplifyOptions } from '../PuzzleLoader-CkghxdIL.js';
|
|
3
3
|
import 'type-fest';
|
|
4
4
|
import 'three/src/Three.js';
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { B as BluetoothPuzzle } from '../bluetooth-puzzle-
|
|
3
|
-
export { A as MoveEvent, O as OrientationEvent } from '../bluetooth-puzzle-
|
|
1
|
+
import { t as PuzzleID, s as PuzzleLoader, a0 as KeyMapping, K as KPattern, r as Alg, M as Move, z as MillisecondTimestamp } from '../PuzzleLoader-CkghxdIL.js';
|
|
2
|
+
import { B as BluetoothPuzzle } from '../bluetooth-puzzle-c-_IBAdu.js';
|
|
3
|
+
export { A as MoveEvent, O as OrientationEvent } from '../bluetooth-puzzle-c-_IBAdu.js';
|
|
4
4
|
import 'type-fest';
|
|
5
5
|
import 'three/src/Three.js';
|
|
6
6
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
binaryComponentsToReid3x3x3,
|
|
3
3
|
twizzleBinaryToBinaryComponents
|
|
4
|
-
} from "../chunks/chunk-
|
|
4
|
+
} from "../chunks/chunk-557DMXD6.js";
|
|
5
5
|
import {
|
|
6
6
|
puzzles
|
|
7
|
-
} from "../chunks/chunk-
|
|
7
|
+
} from "../chunks/chunk-UZ7SWKN6.js";
|
|
8
8
|
import {
|
|
9
9
|
cube3x3x3,
|
|
10
10
|
experimental3x3x3KPuzzle
|
|
11
|
-
} from "../chunks/chunk-
|
|
11
|
+
} from "../chunks/chunk-ST4K23C3.js";
|
|
12
12
|
import {
|
|
13
13
|
KPattern
|
|
14
|
-
} from "../chunks/chunk-
|
|
14
|
+
} from "../chunks/chunk-WAYEJXCG.js";
|
|
15
15
|
import {
|
|
16
16
|
Alg,
|
|
17
17
|
Move,
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
normalize3x3x3Orientation,
|
|
4
4
|
puzzleOrientation3x3x3Cache,
|
|
5
5
|
puzzleOrientation3x3x3Idx
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ST4K23C3.js";
|
|
7
7
|
import {
|
|
8
8
|
KPattern
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-WAYEJXCG.js";
|
|
10
10
|
|
|
11
11
|
// src/cubing/protocol/binary/orbit-indexing.ts
|
|
12
12
|
function identityPermutation(numElems) {
|
|
@@ -262,4 +262,4 @@ export {
|
|
|
262
262
|
bufferToSpacedHex,
|
|
263
263
|
spacedHexToBuffer
|
|
264
264
|
};
|
|
265
|
-
//# sourceMappingURL=chunk-
|
|
265
|
+
//# sourceMappingURL=chunk-557DMXD6.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-7GUL3OBQ.js";
|
|
4
4
|
import {
|
|
5
5
|
node_adapter_default
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZKJKRQKY.js";
|
|
7
7
|
import {
|
|
8
8
|
Alg
|
|
9
9
|
} from "./chunk-7D7ZUWUK.js";
|
|
@@ -348,4 +348,4 @@ export {
|
|
|
348
348
|
solveTwips,
|
|
349
349
|
setSearchDebug
|
|
350
350
|
};
|
|
351
|
-
//# sourceMappingURL=chunk-
|
|
351
|
+
//# sourceMappingURL=chunk-7DT3G3FA.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
cube3x3x3KPuzzleDefinition
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ST4K23C3.js";
|
|
4
4
|
import {
|
|
5
5
|
TraversalUp,
|
|
6
6
|
functionFromTraversal
|
|
@@ -270,4 +270,4 @@ export {
|
|
|
270
270
|
countLeavesInExpansionForSimultaneousMoveIndexer,
|
|
271
271
|
countMetricMoves
|
|
272
272
|
};
|
|
273
|
-
//# sourceMappingURL=chunk-
|
|
273
|
+
//# sourceMappingURL=chunk-I5QO52OG.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
from
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ST4K23C3.js";
|
|
4
4
|
|
|
5
5
|
// src/cubing/twisty/debug.ts
|
|
6
6
|
var twistyDebugGlobals = {
|
|
@@ -527,7 +527,7 @@ var StatsPanel = class {
|
|
|
527
527
|
// src/cubing/twisty/heavy-code-imports/3d.ts
|
|
528
528
|
var cachedConstructorProxy = null;
|
|
529
529
|
async function bulk3DCode() {
|
|
530
|
-
return cachedConstructorProxy ??= import("./twisty-dynamic-3d-
|
|
530
|
+
return cachedConstructorProxy ??= import("./twisty-dynamic-3d-OCL53BVF.js");
|
|
531
531
|
}
|
|
532
532
|
|
|
533
533
|
// src/cubing/twisty/views/canvas.ts
|
|
@@ -1171,4 +1171,4 @@ export {
|
|
|
1171
1171
|
Twisty3DVantage,
|
|
1172
1172
|
bulk3DCode
|
|
1173
1173
|
};
|
|
1174
|
-
//# sourceMappingURL=chunk-
|
|
1174
|
+
//# sourceMappingURL=chunk-KZGAQEPN.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
KPattern,
|
|
3
3
|
KPuzzle
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WAYEJXCG.js";
|
|
5
5
|
import {
|
|
6
6
|
Alg,
|
|
7
7
|
Commutator,
|
|
@@ -1762,4 +1762,4 @@ export {
|
|
|
1762
1762
|
PGPuzzleLoader,
|
|
1763
1763
|
CubePGPuzzleLoader
|
|
1764
1764
|
};
|
|
1765
|
-
//# sourceMappingURL=chunk-
|
|
1765
|
+
//# sourceMappingURL=chunk-ST4K23C3.js.map
|