Reference · Cube engine and views
joinTurnsfunction
Turns of one layer in a row written as one, and any that come to nothing left out: "U' U2" is "U", "U' U" is nothing.
Import it
import { joinTurns } from "@johnmorrisdotca/kyuubu";
Definition
function joinTurns(moves: readonly CubeMove[]): CubeMove[]
Parameters
| Name | Type | Description |
|---|---|---|
moves | readonly CubeMove[] | The turns, in their execution order. |
Returns
CubeMove[]
Turns of one layer in a row written as one, and any that come to nothing left out: "U' U2" is "U", "U' U" is nothing.
Examples
import { joinTurns, movesNotation, parseMove, undoOf } from "@johnmorrisdotca/kyuubu";
const move = parseMove("R", 3)!;
console.log(movesNotation(joinTurns([move, undoOf(move)]), 3));