Reference · Rules, solvers and generation
LinkExtrastype
What a board has besides its lines: the cells no line enters, the bridges two lines cross, and the walls between cells.
Import it
import type { LinkExtras } from "@johnmorrisdotca/tsunagi";
Definition
type LinkExtras = {
blocked?: ReadonlySet<number>;
bridges?: ReadonlySet<number>;
walls?: ReadonlySet<string>;
waypoints?: ReadonlySet<number>;
wrap?: boolean;
hex?: boolean;
sparse?: boolean;
portals?: readonly (readonly [
number,
number
])[];
};
Members
| Name | Type | Description |
|---|---|---|
blocked (optional) | ReadonlySet<number> | undefined | |
bridges (optional) | ReadonlySet<number> | undefined | |
walls (optional) | ReadonlySet<string> | undefined | |
waypoints (optional) | ReadonlySet<number> | undefined | |
wrap (optional) | boolean | undefined | |
hex (optional) | boolean | undefined | |
sparse (optional) | boolean | undefined | |
portals (optional) | readonly (readonly [number, number])[] | undefined |
Examples
import type { LinkExtras } from "@johnmorrisdotca/tsunagi";
const value: LinkExtras = {blocked:new Set([0]),walls:new Set(["1-2"])};
console.log(value);{ blocked: Set(1) { 0 }, walls: Set(1) { '1-2' } }What it prints (run when this page was built)