Skip to content

Commit

Permalink
[puzzles] Add baby_fto.
Browse files Browse the repository at this point in the history
  • Loading branch information
lgarron committed Jan 2, 2025
1 parent 19e893d commit 62a4a75
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 12 deletions.
4 changes: 4 additions & 0 deletions src/cubing/puzzles/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ export const twizzleEvents: Record<string, EventInfo> = {
puzzleID: "redi_cube",
eventName: "Redi Cube",
},
baby_fto: {
puzzleID: "baby_fto",
eventName: "Baby FTO",
},
loopover: {
puzzleID: "loopover",
eventName: "Loopover",
Expand Down
23 changes: 23 additions & 0 deletions src/cubing/puzzles/implementations/baby_fto/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import type { ExperimentalStickering } from "../../../twisty";
import { PGPuzzleLoader } from "../../async/async-pg3d";
import { ftoStickering } from "../../stickerings/fto-stickerings";
import type { StickeringMask } from "../../stickerings/mask";
import { ftoKeyMapping } from "../fto/ftoKeyMapping";

class BabyFTOPuzzleLoader extends PGPuzzleLoader {
constructor() {
super({
pgID: "skewb diamond",
id: "baby_fto",
fullName: "Baby FTO",
inventedBy: ["Uwe Mèffert"],
// inventionYear: TODO
});
}
stickeringMask(stickering: ExperimentalStickering): Promise<StickeringMask> {
return ftoStickering(this, stickering);
}
keyMapping = async () => ftoKeyMapping;
}

export const baby_fto = new BabyFTOPuzzleLoader();
4 changes: 3 additions & 1 deletion src/cubing/puzzles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { CubePGPuzzleLoader, PGPuzzleLoader } from "./async/async-pg3d";
import { cube2x2x2 } from "./implementations/2x2x2";
import { cube3x3x3 } from "./implementations/3x3x3";
import { cube4x4x4 } from "./implementations/4x4x4";
import { baby_fto } from "./implementations/baby_fto";
import { clock } from "./implementations/clock";
import { fto } from "./implementations/fto";
import { kilominx } from "./implementations/kilominx";
Expand Down Expand Up @@ -47,7 +48,7 @@ export const puzzles: Record<string, PuzzleLoader> = {
// 4x4x4 Blindfolded
// 5x5x5 Blindfolded
/******** End of WCA puzzles ********/
fto: fto,
fto,
gigaminx: new PGPuzzleLoader({
id: "gigaminx",
fullName: "Gigaminx",
Expand All @@ -66,4 +67,5 @@ export const puzzles: Record<string, PuzzleLoader> = {
melindas2x2x2x2,
loopover,
tri_quad,
baby_fto,
};
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const puzzleIDs = {
master_tetraminx: true,
kilominx: true,
redi_cube: true,
baby_fto: true,
melindas2x2x2x2: true,
tri_quad: true,
loopover: true,
Expand Down
1 change: 1 addition & 0 deletions src/sites/alpha.twizzle.net/edit/supported-puzzles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ const puzzleData: Partial<
optgroup: OptGroup.Other,
symbol: GeometrySymbol.Square,
},
baby_fto: { optgroup: OptGroup.Other, symbol: GeometrySymbol.TriangleDown },
melindas2x2x2x2: {
"2D": true,
optgroup: OptGroup.Other,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ const megaminxAndKilominx = [
["/space", "BR2", "R2", "F2'", "d'", "F'", "D'", "FR'", ""],
];

const ftoAndBabyFTO = [
["", "U'", "U2'", "L", "l", "u'", "L2", "2L2", "/enter"],
["U", "", "U'", "BL", "Rv'", "BR'", "BL2", "Rv2'", "BR2'"],
["U2", "U", "", "u", "r'", "R'", "Fv'", "2R2'", "R2'"],
["L'", "BL'", "u'", "", "Uv'", "Uv2'", "F'", "2L", "F2"],
["l'", "Rv", "r", "Uv", "", "Uv'", "d'", "Lv", "d"],
["u", "BR", "R", "Uv2", "Uv", "", "F2'", "2R'", "F"],
["L2'", "BL2'", "Fv", "F", "d", "F2", "", "D", "D"],
["2L2'", "Rv2", "2R2", "2L'", "Lv'", "2R", "D'", "", "D"],
["/space", "BR2", "R2", "F2'", "d'", "F'", "D'", "D'", ""],
];

export const moveMaps: Record<PuzzleID, string[][]> = {
"3x3x3": [
["", "U'", "U2'", "L", "l", "u'", "L2", "M2", "/enter"],
Expand Down Expand Up @@ -71,19 +83,10 @@ export const moveMaps: Record<PuzzleID, string[][]> = {
["2L2'", "Rv2", "2R2", "2L'", "Lv'", "2R", "D'", "", "D"],
["/space", "B2", "R2", "F2'", "d'", "F'", "D2'", "D'", ""],
],
fto: [
["", "U'", "U2'", "L", "l", "u'", "L2", "2L2", "/enter"],
["U", "", "U'", "BL", "Rv'", "BR'", "BL2", "Rv2'", "BR2'"],
["U2", "U", "", "u", "r'", "R'", "Fv'", "2R2'", "R2'"],
["L'", "BL'", "u'", "", "Uv'", "Uv2'", "F'", "2L", "F2"],
["l'", "Rv", "r", "Uv", "", "Uv'", "d'", "Lv", "d"],
["u", "BR", "R", "Uv2", "Uv", "", "F2'", "2R'", "F"],
["L2'", "BL2'", "Fv", "F", "d", "F2", "", "D", "D"],
["2L2'", "Rv2", "2R2", "2L'", "Lv'", "2R", "D'", "", "D"],
["/space", "BR2", "R2", "F2'", "d'", "F'", "D'", "D'", ""],
],
fto: ftoAndBabyFTO,
megaminx: megaminxAndKilominx,
kilominx: megaminxAndKilominx,
baby_fto: ftoAndBabyFTO,
tri_quad: [
["", "U'", "U2'", "", "", "", "", "", "/enter"],
["U", "", "U'", "", "", "", "", "", ""],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const puzzleIDs = {
megaminx: true,
kilominx: true,
tri_quad: true,
baby_fto: true,
};
export const DEFAULT_PUZZLE_ID = "3x3x3";
export type PuzzleID = keyof typeof puzzleIDs;
Expand Down

0 comments on commit 62a4a75

Please sign in to comment.