Reference · Cube engine and views
permutationOffunction
Where every sticker goes under one turn: to[i] is the slot the sticker in
slot i lands on. Worked out once and kept.
Import it
import { permutationOf } from "@johnmorrisdotca/kyuubu";
Definition
function permutationOf(n: number, move: CubeMove): Int32Array
Parameters
| Name | Type | Description |
|---|---|---|
n | number | The cube’s side length. |
move | CubeMove | The turn to apply, name or invert. |
Returns
Int32Array<ArrayBufferLike>
Where every sticker goes under one turn: to[i] is the slot the sticker in slot i lands on. Worked out once and kept.
Examples
import { parseMove, permutationOf } from "@johnmorrisdotca/kyuubu";
const move = parseMove("R", 3)!;
console.log(Array.from(permutationOf(3, move)).slice(0, 6));[ 0, 1, 51, 3, 4, 48 ]What it prints (run when this page was built)