Reference · Boards, rules and challenges
challengeOffunction
Generates a seeded challenge on a built-in shape, optionally fixing its final hole.
Import it
import { challengeOf } from "@johnmorrisdotca/tobiishi";
Definition
function challengeOf(shape: Shape, seed?: string, jumps?: number, goal?: Cell): Challenge
Parameters
| Name | Type | Description |
|---|---|---|
shape | Shape | One of the built-in SHAPES. |
seed (optional) | string | A reproducible text seed. |
jumps (optional) | number | Requested reverse-growth jump count, from 1 up to board cell count minus 1. |
goal (optional) | Readonly<{ x: number; y: number; }> | undefined | A required final native hole index or coordinate, as specified by this signature. |
Returns
Readonly<{ game: Game; answer: readonly Jump[]; seed: string; }>
Generates a seeded challenge on a built-in shape, optionally fixing its final hole.
Examples
import { challengeOf } from "@johnmorrisdotca/tobiishi";
console.log(challengeOf("triangle","sample",3).answer.length);3What it prints (run when this page was built)