Reference · Cube engine and views
parseSolvefunction
A solve, or a scramble, read from the way it is written, for a cube of this size. Everything it could read comes back even when it stops at a fault, so a page can show how far it got.
Import it
import { parseSolve } from "@johnmorrisdotca/kyuubu";
Definition
function parseSolve(text: string, n: number): SolveReading
Parameters
| Name | Type | Description |
|---|---|---|
text | string | The text to parse or format. |
n | number | The cube’s side length. |
Returns
SolveReading
A solve, or a scramble, read from the way it is written, for a cube of this size. Everything it could read comes back even when it stops at a fault, so a page can show how far it got.
Examples
import { parseSolve } from "@johnmorrisdotca/kyuubu";
console.log(parseSolve("R U2", 3));{
ok: true,
steps: [
{ text: 'R', moves: [Array], counts: true, at: 0 },
{ text: 'U2', moves: [Array], counts: true, at: 2 }
]
}What it prints (run when this page was built)