Reference · Cube engine and views
moveFitsfunction
Whether a move can be made on a cube of this size.
Import it
import { moveFits } from "@johnmorrisdotca/kyuubu";
Definition
function moveFits(n: number, move: CubeMove): boolean
Parameters
| Name | Type | Description |
|---|---|---|
n | number | The cube’s side length. |
move | CubeMove | The turn to apply, name or invert. |
Returns
boolean
Whether a move can be made on a cube of this size.
Examples
import { moveFits, parseMove } from "@johnmorrisdotca/kyuubu";
const move = parseMove("R", 3)!;
console.log(moveFits(3, move));trueWhat it prints (run when this page was built)