Skip to content

Commit f9b74a8

Browse files
committed
[puzzle-geometry] Rename several icosehedral puzzles.
As suggested at: #336
1 parent 2ddd0dd commit f9b74a8

File tree

6 files changed

+32
-13
lines changed

6 files changed

+32
-13
lines changed

script/test/src/import-restrictions/allowedImports.ts

+3
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ export const mainAllowedImports: AllowedImports = {
148148
"src/sites/experiments.cubing.net/cubing.js/rust/wasm": {
149149
static: ["getbuiltinmodule-ponyfill"],
150150
},
151+
"src/sites/alpha.twizzle.net/explore": {
152+
static: ["src/cubing/puzzle-geometry/cubing-private"],
153+
},
151154
};
152155

153156
// This is a separate definition because the `spec` files are interleaved with source files, and it's easier to run a separate check for them.

src/bin/puzzle-geometry-bin.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ little chop, pyramorphix, mastermorphix, pyraminx, Jing pyraminx,
142142
master paramorphix, megaminx, gigaminx, pentultimate, starminx,
143143
starminx 2, pyraminx crystal, chopasaurus, big chop, skewb diamond,
144144
FTO, Christopher's jewel, octastar, Trajber's octahedron, radio chop,
145-
icosamate, icosahedron 2, icosahedron 3, icosahedron static faces,
146-
icosahedron moving faces, and Eitan's star.
145+
icosamate, Regular Astrominx, Regular Astrominx + Big Chop,
146+
Redicosahedron, Redicosahedron with centers,Icosaminx, and Eitan's star.
147147
148148
Examples:
149149
puzzlegeometry --ss 2x2x2

src/cubing/puzzle-geometry/PGPuzzles.spec.ts

+7-6
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,15 @@ const expectedData: { [name: string]: string | null } = {
8080
"Trajber's octahedron": "Trajber's octahedron, 8, 7, 26, 3, 9, 120",
8181
"radio chop": "radio chop, 20, 10, 92, 3, 20, 41580",
8282
icosamate: slow("icosamate, 20, 4, 32, 2, 12, 720"),
83-
"icosahedron 2": slow("icosahedron 2, 20, 9, 102, 3, 18, 432630"),
84-
"icosahedron 3": slow("icosahedron 3, 20, 18, 360, 6, 48, 1615854240"),
85-
"icosahedron static faces": slow(
86-
"icosahedron static faces, 20, 7, 62, 3, 18, 180",
83+
"Regular Astrominx": slow("Regular Astrominx, 20, 9, 102, 3, 18, 432630"),
84+
"Regular Astrominx + Big Chop": slow(
85+
"Regular Astrominx + Big Chop, 20, 18, 360, 6, 48, 1615854240",
8786
),
88-
"icosahedron moving faces": slow(
89-
"icosahedron moving faces, 20, 7, 62, 3, 18, 180",
87+
Redicosahedron: slow("Redicosahedron, 20, 6, 42, 2, 18, 180"),
88+
"Redicosahedron with centers": slow(
89+
"Redicosahedron with centers, 20, 7, 62, 3, 18, 180",
9090
),
91+
Icosaminx: slow("Icosaminx, 20, 7, 62, 3, 18, 180"),
9192
"Eitan's star": slow("Eitan's star, 20, 13, 152, 4, 30, 384560"),
9293
"2x2x2 + dino": "2x2x2 + dino, 6, 8, 24, 1, 18, 70",
9394
"2x2x2 + little chop": "2x2x2 + little chop, 6, 8, 48, 2, 18, 168",

src/cubing/puzzle-geometry/PGPuzzles.ts

+12-4
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,11 @@ export const PGPuzzles: { [name: string]: PuzzleDescriptionString } = {
7272
"Trajber's octahedron": "o v 0.433012701892219",
7373
"radio chop": "i f 0",
7474
icosamate: "i v 0",
75-
"icosahedron 2": "i v 0.18759247376021",
76-
"icosahedron 3": "i v 0.18759247376021 e 0",
77-
"icosahedron static faces": "i v 0.84",
78-
"icosahedron moving faces": "i v 0.73",
75+
"Regular Astrominx": "i v 0.18759247376021",
76+
"Regular Astrominx + Big Chop": "i v 0.18759247376021 e 0",
77+
Redicosahedron: "i v 0.794654472291766",
78+
"Redicosahedron with centers": "i v 0.84",
79+
Icosaminx: "i v 0.73",
7980
"Eitan's star": "i f 0.61803398874989",
8081
"2x2x2 + dino": "c f 0 v 0.577350269189626",
8182
"2x2x2 + little chop": "c f 0 e 0",
@@ -85,4 +86,11 @@ export const PGPuzzles: { [name: string]: PuzzleDescriptionString } = {
8586
"starminx combo": "d f 0.23606797749979 v 0.937962370425399",
8687
};
8788

89+
export const legacyPuzzleNameMapping: Partial<Record<string, string>> = {
90+
"icosahedron 2": "Regular Astrominx",
91+
"icosahedron 3": "Regular Astrominx + Big Chop",
92+
"icosahedron static faces": "Redicosahedron with centers",
93+
"icosahedron moving faces": "Icosaminx",
94+
};
95+
8896
export type PuzzleName = keyof typeof PGPuzzles;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { legacyPuzzleNameMapping } from "../PGPuzzles";

src/sites/alpha.twizzle.net/explore/url-params.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
// TODO: implement URL listener.
22

33
import { Alg } from "../../../cubing/alg";
4+
import { legacyPuzzleNameMapping } from "../../../cubing/puzzle-geometry/cubing-private";
45

56
export interface PartialURLParamValues {
67
alg?: Alg;
78
puzzle?: string;
89
puzzlegeometry?: string;
9-
"puzzle-description": string;
10+
"puzzle-description"?: string;
1011
"debug-show-render-stats"?: boolean;
1112
tempo?: string;
1213
}
@@ -135,3 +136,8 @@ export function setURLParams(newParams: PartialURLParamValues): void {
135136
}
136137
window.history.replaceState("", "", url.toString());
137138
}
139+
140+
const remappedPuzzleName = legacyPuzzleNameMapping[getURLParam("puzzle")];
141+
if (remappedPuzzleName) {
142+
setURLParams({ puzzle: remappedPuzzleName });
143+
}

0 commit comments

Comments
 (0)