legalCuboidMovesfunction
Every move a cuboid can make, by axis, layer and turn.
Import it
import { legalCuboidMoves } from "@johnmorrisdotca/kyuubu/cuboid";
Definition
function legalCuboidMoves(dims: CuboidDims): CuboidMove[]
Parameters
| Name | Type | Description |
|---|---|---|
dims | CuboidDims | The cuboid’s x, y and z dimensions, in that order. |
Returns
CuboidMove[]
Every move a cuboid can make, by axis, layer and turn.
Examples
import { legalCuboidMoves } from "@johnmorrisdotca/kyuubu/cuboid";
const dims = [2, 3, 3] as const;
console.log(legalCuboidMoves(dims).length);12What it prints (run when this page was built)