Reference · Cube engine and views
readSolveLinkfunction
A solve read out of a link to alg.cubing.net, the page most reconstructions
are shared by, so that a person can paste the address and not copy two
boxes by hand. In such a link a space is written _, a ' is written -
and a new line %0A; the scramble is its setup and the solve its alg.
Null for anything that is not such a link.
Import it
import { readSolveLink } from "@johnmorrisdotca/kyuubu";
Definition
function readSolveLink(text: string): SolveLink | null
Parameters
| Name | Type | Description |
|---|---|---|
text | string | The text to parse or format. |
Returns
SolveLink | null
A solve read out of a link to alg.cubing.net, the page most reconstructions are shared by, so that a person can paste the address and not copy two boxes by hand. In such a link a space is written _, a ' is written - and a new line %0A; the scramble is its setup and the solve its alg. null for anything that is not such a link.
Examples
import { readSolveLink } from "@johnmorrisdotca/kyuubu";
console.log(readSolveLink("https://alg.cubing.net/?setup=R_U&alg=U-_R-"));{ scramble: 'R U', solution: "U' R'" }What it prints (run when this page was built)