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