Reference · Pipes, rules and solving
canTurnAtfunction
Whether a tap on cell of a game turns anything. On a piece of its own: it looks different turned, and it
is not locked. In a block (blocks.ts): turning the block changes how its four pieces face.
Import it
import { canTurnAt } from "@johnmorrisdotca/suido";
Definition
function canTurnAt(game: Game, cell: number): boolean
Parameters
| Name | Type | Description |
|---|---|---|
game | Game | The current immutable game state. |
cell | number | A zero-based row-major cell index. |
Returns
boolean
Whether a tap on cell of a game turns anything. On a piece of its own: it looks different turned, and it is not locked. In a block (blocks.ts): turning the block changes how its four pieces face.
Examples
import { SUIDO_5X5 } from "@johnmorrisdotca/suido/levels-5x5";
import { canTurnAt, newGame } from "@johnmorrisdotca/suido";
const row = SUIDO_5X5[0];
const code = row[0];
const game = newGame(code)!;
console.log(canTurnAt(game,0));trueWhat it prints (run when this page was built)