本文へ移動

Houseki宝石

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

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

目次

リファレンス · 三つの宝石

ChallengeSettings型

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

The fixed Falling Triplets challenge settings with the original board and finite triplet queue.

インポート

import type { ChallengeSettings } from "@johnmorrisdotca/houseki/falling-triplets";

定義

interface ChallengeSettings extends Settings {
    readonly mode: 'challenge';
    readonly goal: ChallengeGoal['type'];
    readonly challengeBoard: readonly (Gem | null)[];
    readonly challengeQueue: readonly Triplet[];
}

メンバー

名前型説明
mode"challenge"
goal"targets" | "chain" | "empty"
challengeBoardreadonly (Gem | null)[]
challengeQueuereadonly Triplet[]
widthnumber
heightnumber
colourCount4 | 5 | 6
seedstring
pieceLimit (省略可)number | undefined
targetIds (省略可)readonly number[] | undefined
minimumChain (省略可)number | undefined
witness (省略可)readonly ChallengeHint[] | undefined

例

import { createGame } from "@johnmorrisdotca/houseki/falling-triplets";
import type { ChallengeSettings } from "@johnmorrisdotca/houseki/falling-triplets";

const state=createGame({seed:"docs"});
const value: ChallengeSettings = {...state.settings,mode:"challenge",goal:"empty",challengeBoard:state.board,challengeQueue:[["red","green","blue"]]};
console.log(value == null ? value : typeof value === "object" ? Object.keys(value).slice(0,6) : value);
[ 'mode', 'width', 'height', 'colourCount', 'seed', 'goal' ]

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

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

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