Reference · Rules, solvers and generation
newTsunagiGamefunction
A game on a layout code, or null for a code that is no layout at that size.
Import it
import { newTsunagiGame } from "@johnmorrisdotca/tsunagi";
Definition
function newTsunagiGame(givens: string, size: number, options?: TsunagiGameOptions): TsunagiGame | null
Parameters
| Name | Type | Description |
|---|---|---|
givens | string | The original native layout code. |
size | number | The number of cells on each side of the board. |
options (optional) | TsunagiGameOptions | Native drawing, geometry, game or mount settings. |
Returns
TsunagiGame | null
A game on a layout code, or null for a code that is no layout at that size.
Examples
import { TSUNAGI_4 } from "@johnmorrisdotca/tsunagi/levels-4";
import { newTsunagiGame } from "@johnmorrisdotca/tsunagi";
const givens = TSUNAGI_4[0][0];
const answer = TSUNAGI_4[0][1];
console.log(newTsunagiGame(givens,4,{answer})?.solved);falseWhat it prints (run when this page was built)