Reference · Rules, solvers and generation
GeneratorOptionstype
How a board's lines are grown and how it is proved, every part with a default, and the twists to plant on it.
Import it
import type { GeneratorOptions } from "@johnmorrisdotca/tsunagi";
Definition
type GeneratorOptions = {
longest?: number;
most?: number;
budget?: number;
mends?: number;
tries?: number;
warps?: number;
bridges?: number;
waypoints?: number;
};
Members
| Name | Type | Description |
|---|---|---|
longest (optional) | number | undefined | The longest a line may grow, in cells. Default three times the board's longer side. |
most (optional) | number | undefined | The most lines the board may end with, else this path is dropped for another. |
budget (optional) | number | undefined | What one proof may spend before this path is dropped, so that a hard board costs a retry and not a long wait: 20,000 positions to 12×12, and from 13×13, on a honeycomb and with warps 3,000 dead ends. |
mends (optional) | number | undefined | How many times a board with two answers is mended before this path is dropped. Default 60. |
tries (optional) | number | undefined | How many paths are tried before the generator says it found nothing. Default 30. |
warps (optional) | number | undefined | How many marked warps (portals) to plant. Not on a honeycomb. |
bridges (optional) | number | undefined | How many bridges to plant. Not on a honeycomb, nor with warps. |
waypoints (optional) | number | undefined | How many waypoints to plant. |
Examples
import type { GeneratorOptions } from "@johnmorrisdotca/tsunagi";
const value: GeneratorOptions = {longest:30,budget:2000,warps:1};
console.log(value);{ longest: 30, budget: 2000, warps: 1 }What it prints (run when this page was built)