Reference · Cube engine and views
movesForReleasefunction
Every layer a release turns: the picked layer, and the one beside it where the drag took a seam, each by those quarters; none for none.
Import it
import { movesForRelease } from "@johnmorrisdotca/kyuubu";
Definition
function movesForRelease(pick: DragPick, quarters: number): CubeMove[]
Parameters
| Name | Type | Description |
|---|---|---|
pick | DragPick | The layer and screen direction selected by a drag. |
quarters | number | The signed number of quarter turns on release; 0 cancels the move. |
Returns
CubeMove[]
Every layer a release turns: the picked layer, and the one beside it where the drag took a seam, each by those quarters; none for none.
Examples
import { movesForRelease } from "@johnmorrisdotca/kyuubu";
const pick = { axis: 0 as const, layer: 2, along: [1, 0] as [number, number] };
console.log(movesForRelease(pick, 1));[ { axis: 0, layer: 2, turns: 1 } ]What it prints (run when this page was built)