Reference · Rules, solvers and generation
Steptype
WHERE A LINE MAY GO NEXT, on one board: the rules of a single step, which the solver, the check, the drawing and the answer's lines all read, so a bridge or a wall means the same thing everywhere.
- Across an open edge (no wall) to the next cell.
- Onto a BRIDGE only to go straight over it: into the cell beyond, the same way on, never turning. Going across uses the bridge's across slot, going down its down slot; the two are crossed by two different lines.
- Into a PORTAL cell, and so out of the other one the same way on: the step
is to the cell beyond the far portal, and the line takes both portal
cells on the way (
through, in the order it passes them). A portal cell itself has no steps and is never where a step ends; where the cell beyond the far portal is blocked, off the board or across a wall, that way into the portal is no step at all.
Imports carry their .ts so the level script can run this under plain node.
Import it
import type { Step } from "@johnmorrisdotca/tsunagi";
Definition
type Step = {
to: number;
over: number;
across: boolean;
through: readonly number[];
};
Members
| Name | Type | Description |
|---|---|---|
to | number | The cell the line reaches. |
over | number | The bridge gone over on the way, or -1 for a plain step. |
across | boolean | Over a bridge: whether across (left or right) rather than down (up or down). |
through | readonly number[] | The portal cells gone through on the way, in order: the one stepped into, then its other. Empty for a step that goes through none. |
Examples
import type { Step } from "@johnmorrisdotca/tsunagi";
const value: Step = {to:1,over:-1,across:true,through:[]};
console.log(value);{ to: 1, over: -1, across: true, through: [] }What it prints (run when this page was built)