Reference · Cube engine and views
turnAllfunction
The state after every turn in order.
Import it
import { turnAll } from "@johnmorrisdotca/kyuubu";
Definition
function turnAll(state: string, n: number, moves: readonly CubeMove[]): string
Parameters
| Name | Type | Description |
|---|---|---|
state | string | The sticker-state string in the package’s face order. |
n | number | The cube’s side length. |
moves | readonly CubeMove[] | The turns, in their execution order. |
Returns
string
The state after every turn in order.
Examples
import { cubeSolved, parseMoves, solvedCube, turnAll, undoAll } from "@johnmorrisdotca/kyuubu";
const state = solvedCube(3);
const moves = parseMoves("R U2", 3)!;
console.log(cubeSolved(turnAll(state, 3, [...moves, ...undoAll(moves)]), 3));trueWhat it prints (run when this page was built)