Reference · Rules, solvers and generation
generateTsunagifunction
One level for any board, proved to have exactly one answer, or null where this seed found none in its tries. Null is an honest answer: nothing here returns a board it could not prove.
Import it
import { generateTsunagi } from "@johnmorrisdotca/tsunagi";
Definition
function generateTsunagi(board: TsunagiBoard, random: Random, options?: GeneratorOptions): LinkCandidate | null
Parameters
| Name | Type | Description |
|---|---|---|
board | TsunagiBoard | The board as a graph ( |
random | Random | A reproducible random source returning values in [0,1). |
options (optional) | GeneratorOptions | How its lines run, what the proof may spend, and the twists to plant. |
Returns
LinkCandidate | null
A candidate proved to have one answer, or null.
Examples
import { generateTsunagi, seededRandom, squareBoard } from "@johnmorrisdotca/tsunagi";
console.log(generateTsunagi(squareBoard(5),seededRandom(42))?.layout);ABCD....B.A.C..D.........What it prints (run when this page was built)