Reference · Cube engine and views
isCubeStatefunction
Whether a string is a state of a cube this size: the right length, and the right number of every colour.
Import it
import { isCubeState } from "@johnmorrisdotca/kyuubu";
Definition
function isCubeState(state: string, n: number): boolean
Parameters
| Name | Type | Description |
|---|---|---|
state | string | The sticker-state string in the package’s face order. |
n | number | The cube’s side length. |
Returns
boolean
Whether a string is a state of a cube this size: the right length, and the right number of every colour.
Examples
import { isCubeState, solvedCube } from "@johnmorrisdotca/kyuubu";
const state = solvedCube(3);
console.log(isCubeState(state, 3));trueWhat it prints (run when this page was built)