ChallengeOptionstype
Authored challenge inputs including the starting board, finite goal and supplied witness.
Import it
import type { ChallengeOptions } from "@johnmorrisdotca/houseki/stone-collapse";
Definition
interface ChallengeOptions {
readonly id: string;
readonly width: number;
readonly height: number;
readonly colourCount: 4 | 5 | 6;
readonly seed?: string | number;
readonly mask?: readonly boolean[];
readonly initialBoard: readonly (Stone | null)[];
readonly goal: ChallengeGoal;
readonly moveLimit?: number;
readonly witness: readonly (readonly number[])[];
}
Members
| Name | Type | Description |
|---|---|---|
id | string | |
width | number | |
height | number | |
colourCount | 4 | 5 | 6 | |
seed (optional) | string | number | undefined | |
mask (optional) | readonly boolean[] | undefined | |
initialBoard | readonly (Stone | null)[] | |
goal | ChallengeGoal | |
moveLimit (optional) | number | undefined | |
witness | readonly (readonly number[])[] |
Examples
import { createGame } from "@johnmorrisdotca/houseki/stone-collapse";
import type { ChallengeOptions } from "@johnmorrisdotca/houseki/stone-collapse";
const state=createGame({seed:"docs"});
const value: ChallengeOptions = {id:"docs",width:6,height:6,colourCount:4,initialBoard:state.board,goal:{kind:"clear-all"},witness:[]};
console.log(value == null ? value : typeof value === "object" ? Object.keys(value).slice(0,6) : value);[ 'id', 'width', 'height', 'colourCount', 'initialBoard', 'goal' ]What it prints (run when this page was built)