Reference · Rules, solvers and generation
layoutStepfunction
A layout's step from a to its neighbour b (stepBetween on its own kind of board), or 0.
Import it
import { layoutStep } from "@johnmorrisdotca/tsunagi";
Definition
function layoutStep(layout: LinkLayout, a: number, b: number): number
Parameters
| Name | Type | Description |
|---|---|---|
layout | LinkLayout | The decoded native board and its rule settings. |
a | number | The first cell index. |
b | number | The second cell index. |
Returns
number
A layout's step from a to its neighbour b (stepBetween on its own kind of board), or 0.
Examples
import { TSUNAGI_4 } from "@johnmorrisdotca/tsunagi/levels-4";
import { decodeLayout, layoutStep } from "@johnmorrisdotca/tsunagi";
const givens = TSUNAGI_4[0][0];
const layout = decodeLayout(givens,4)!;
console.log(layoutStep(layout,0,1));1What it prints (run when this page was built)