本文へ移動

Houseki宝石

5つの宝石と石のゲームの仕組みを使い、測定したチャレンジやレッスンで遊び、再現できるゲームを保存できます。

宝石(ほうせき)は、宝石や貴石を意味する日本語です。 名前について(英語)

目次

リファレンス · ストーンコラプス

ChallengeDefinition型

リファレンスの説明と例は英語です。見出しと目次は日本語です。

A validated Stone Collapse authored setup and stable-id group witness.

インポート

import type { ChallengeDefinition } from "@johnmorrisdotca/houseki/stone-collapse";

定義

interface ChallengeDefinition {
    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[])[];
}

メンバー

名前型説明
idstring
widthnumber
heightnumber
colourCount4 | 5 | 6
seedstring | number
maskreadonly boolean[]
initialBoardreadonly (Stone | null)[]
goalChallengeGoal
moveLimit (省略可)number | undefined
witnessreadonly (readonly number[])[]

Each entry is the complete stable-ID set of the next witnessed group.

例

import { createGame } from "@johnmorrisdotca/houseki/stone-collapse";
import type { ChallengeDefinition } from "@johnmorrisdotca/houseki/stone-collapse";

const state=createGame({seed:"docs"});
const value: ChallengeDefinition = {id:"docs",width:state.settings.width,height:state.settings.height,colourCount:4,seed:"docs",mask:state.settings.mask,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', 'seed', 'mask' ]

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/houseki 0.4.2 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。