Skip to content

Commit

Permalink
[puzzles] Add 4x4x4, 6x6x6, 7x7x7.
Browse files Browse the repository at this point in the history
  • Loading branch information
lgarron committed Jan 16, 2021
1 parent a1fa375 commit 7c2f694
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/cubing/puzzles/async/async-pg3d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ export async function asyncGetPuzzleGeometry(
export async function asyncGetDef(
puzzleName: string,
): Promise<KPuzzleDefinition> {
return (await asyncGetPuzzleGeometry(puzzleName)).writekpuzzle(false);
return (await asyncGetPuzzleGeometry(puzzleName)).writekpuzzle(true);
}
16 changes: 16 additions & 0 deletions src/cubing/puzzles/implementations/4x4x4/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { asyncGetDef, asyncGetPuzzleGeometry } from "../../async/async-pg3d";
import { PuzzleManager } from "../../PuzzleManager";

export const cube4x4x4: PuzzleManager = {
id: "4x4x4",
fullName: "4x4x4",
def: async () => {
return asyncGetDef("4x4x4");
},
svg: async () => {
throw "Unimplemented!";
},
pg: async () => {
return asyncGetPuzzleGeometry("4x4x4");
},
};
16 changes: 16 additions & 0 deletions src/cubing/puzzles/implementations/6x6x6/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { asyncGetDef, asyncGetPuzzleGeometry } from "../../async/async-pg3d";
import { PuzzleManager } from "../../PuzzleManager";

export const cube6x6x6: PuzzleManager = {
id: "6x6x6",
fullName: "6x6x6",
def: async () => {
return asyncGetDef("6x6x6");
},
svg: async () => {
throw "Unimplemented!";
},
pg: async () => {
return asyncGetPuzzleGeometry("6x6x6");
},
};
16 changes: 16 additions & 0 deletions src/cubing/puzzles/implementations/7x7x7/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { asyncGetDef, asyncGetPuzzleGeometry } from "../../async/async-pg3d";
import { PuzzleManager } from "../../PuzzleManager";

export const cube7x7x7: PuzzleManager = {
id: "7x7x7",
fullName: "7x7x7",
def: async () => {
return asyncGetDef("7x7x7");
},
svg: async () => {
throw "Unimplemented!";
},
pg: async () => {
return asyncGetPuzzleGeometry("7x7x7");
},
};
10 changes: 6 additions & 4 deletions src/cubing/puzzles/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { cube2x2x2 } from "./implementations/2x2x2";
import { cube3x3x3 } from "./implementations/3x3x3";
import { cube4x4x4 } from "./implementations/4x4x4";
import { cube5x5x5 } from "./implementations/5x5x5";
import { cube6x6x6 } from "./implementations/6x6x6";
import { cube7x7x7 } from "./implementations/7x7x7";
import { clock } from "./implementations/clock";
import { fto } from "./implementations/fto";
import { megaminx } from "./implementations/megaminx";
Expand All @@ -13,11 +16,10 @@ export const puzzles: Record<string, PuzzleManager> = {
/******** Start of WCA Puzzles *******/
"3x3x3": cube3x3x3,
"2x2x2": cube2x2x2,
// 4x4x4 Cube
// 5x5x5 Cube
"4x4x4": cube4x4x4,
"5x5x5": cube5x5x5,
// 6x6x6 Cube
// 7x7x7 Cube
"6x6x6": cube6x6x6,
"7x7x7": cube7x7x7,
// 3x3x3 Blindfolded
// 3x3x3 Fewest Moves
// 3x3x3 One-Handed
Expand Down
3 changes: 1 addition & 2 deletions src/demo/twisty/inline.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
></twisty-player>
<p>This should be 2D:</p>
<twisty-player
puzzle="3x3x3"
puzzle="4x4x4"
alg="R U R' U' R' F R2 U' R' U' R U R' F'"
visualization="2D"
></twisty-player>
<p>Pyraminx 2D:</p>
<twisty-player
Expand Down

0 comments on commit 7c2f694

Please sign in to comment.