Reference · Number-puzzle engines
lineFromfunction
The cells a clue looks along, nearest first: the clue at at on the top
looks down column at, on the bottom up it, on the left along row at
to the right, on the right along it to the left.
Import it
import { lineFrom } from "@johnmorrisdotca/kazu";
Definition
function lineFrom(side: TowerSide, at: number, size: number): number[]
Parameters
| Name | Type | Description |
|---|---|---|
side | "right" | "left" | "top" | "bottom" | The top, bottom, left or right clue side. |
at | number | The zero-based clue index along the named side. |
size | number | The supported square grid side length. |
Returns
number[]
The cells a clue looks along, nearest first: the clue at at on the top looks down column at, on the bottom up it, on the left along row at to the right, on the right along it to the left.
Examples
import { lineFrom } from "@johnmorrisdotca/kazu";
console.log(lineFrom("top",0,4));[ 0, 4, 8, 12 ]What it prints (run when this page was built)