isCuboidStatefunction
Whether a string is a state of a cuboid this size: the right length, and each face's letter as many times as the face has stickers. It does not say the state can be reached by turning.
Import it
import { isCuboidState } from "@johnmorrisdotca/kyuubu/cuboid";
Definition
function isCuboidState(state: string, dims: CuboidDims): boolean
Parameters
| Name | Type | Description |
|---|---|---|
state | string | The sticker-state string in the package’s face order. |
dims | CuboidDims | The cuboid’s x, y and z dimensions, in that order. |
Returns
boolean
Whether a string is a state of a cuboid this size: the right length, and each face's letter as many times as the face has stickers. It does not say the state can be reached by turning.
Examples
import { isCuboidState, solvedCuboid } from "@johnmorrisdotca/kyuubu/cuboid";
const dims = [2, 3, 3] as const;
console.log(isCuboidState(solvedCuboid(dims), dims));trueWhat it prints (run when this page was built)