ChallengeOptionstype
Authored challenge inputs including the starting board, finite goal and supplied witness.
Import it
import type { ChallengeOptions } from "@johnmorrisdotca/houseki/falling-triplets";
Definition
interface ChallengeOptions {
readonly seed?: string;
readonly width?: number;
readonly height?: number;
readonly colourCount?: 4 | 5 | 6;
readonly board: readonly (Gem | null)[];
readonly queue: readonly Triplet[];
readonly goal: ChallengeGoal;
readonly witness?: readonly ChallengeHint[];
}
Members
| Name | Type | Description |
|---|---|---|
seed (optional) | string | undefined | |
width (optional) | number | undefined | |
height (optional) | number | undefined | |
colourCount (optional) | 4 | 5 | 6 | undefined | |
board | readonly (Gem | null)[] | |
queue | readonly Triplet[] | |
goal | ChallengeGoal | |
witness (optional) | readonly ChallengeHint[] | undefined |
Examples
import { createGame } from "@johnmorrisdotca/houseki/falling-triplets";
import type { ChallengeOptions } from "@johnmorrisdotca/houseki/falling-triplets";
const state=createGame({seed:"docs"});
const value: ChallengeOptions = {width:6,height:12,board:state.board,queue:[["red","green","blue"]],goal:{type:"empty"}};
console.log(value == null ? value : typeof value === "object" ? Object.keys(value).slice(0,6) : value);[ 'width', 'height', 'board', 'queue', 'goal' ]What it prints (run when this page was built)