Reference · Rules, solvers and generation
wrappedStepfunction
The cell beside at one step by (-1, +1, -size, +size) on a board that wraps: off one edge and in at the other.
Import it
import { wrappedStep } from "@johnmorrisdotca/tsunagi";
Definition
function wrappedStep(size: number, at: number, by: number): number
Parameters
| Name | Type | Description |
|---|---|---|
size | number | The number of cells on each side of the board. |
at | number | The zero-based cell index. |
by | number | The signed cell-index step. |
Returns
number
The cell beside at one step by (-1, +1, -size, +size) on a board that wraps: off one edge and in at the other.
Examples
import { wrappedStep } from "@johnmorrisdotca/tsunagi";
console.log(wrappedStep(4,3,1));0What it prints (run when this page was built)