Reference · Cube engine and views
cubeSolvedfunction
SOLVED: every face one colour. Which colour does not matter, so a cube solved and then turned whole in the hand is still solved, and a 2×2 or 4×4, which has no fixed centres, is solved in whichever way round it ends.
Import it
import { cubeSolved } from "@johnmorrisdotca/kyuubu";
Definition
function cubeSolved(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
SOLVED: every face one colour. Which colour does not matter, so a cube solved and then turned whole in the hand is still solved, and a 2×2 or 4×4, which has no fixed centres, is solved in whichever way round it ends.
Examples
import { cubeSolved, solvedCube } from "@johnmorrisdotca/kyuubu";
const state = solvedCube(3);
console.log(cubeSolved(state, 3));trueWhat it prints (run when this page was built)