本文へ移動

Houseki宝石

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

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

目次

リファレンス · ジェムスワップ

GemSwapCampaignLevel型

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

One authored native challenge with its stable id, setup, winning witness, measurements and review status.

インポート

import type { GemSwapCampaignLevel } from "@johnmorrisdotca/houseki/gem-swap";

定義

interface GemSwapCampaignLevel {
    readonly id: string;
    readonly number: number;
    readonly title: {
        readonly en: string;
        readonly ja: string;
    };
    readonly options: CreateOptions;
    readonly width: number;
    readonly height: number;
    readonly colourCount: number;
    readonly seed: number;
    readonly challenge: NonNullable<CreateOptions['challenge']>;
    readonly witness: readonly ReplayOperation[];
    readonly canonicalKeyHash: string;
    readonly tags: readonly string[];
    readonly rawMetrics: Readonly<Record<string, number>>;
    readonly difficultyScore: number;
    readonly difficultyMarks: number;
    readonly gradingVersion: string;
    readonly proofStatus: 'engine-witness-verified';
    readonly reviewStatus: GemSwapReviewStatus;
}

メンバー

名前型説明
idstring
numbernumber
title{ readonly en: string; readonly ja: string; }
optionsCreateOptions
widthnumber
heightnumber
colourCountnumber
seednumber
challengeChallengeRules
witnessreadonly ReplayOperation[]
canonicalKeyHashstring
tagsreadonly string[]
rawMetricsReadonly<Record<string, number>>
difficultyScorenumber
difficultyMarksnumber
gradingVersionstring
proofStatus"engine-witness-verified"
reviewStatus"human-review-pending"

例

import { GEM_SWAP_CAMPAIGN } from "@johnmorrisdotca/houseki/gem-swap";
import type { GemSwapCampaignLevel } from "@johnmorrisdotca/houseki/gem-swap";

const level=GEM_SWAP_CAMPAIGN[0];
const value: GemSwapCampaignLevel = level;
console.log(value == null ? value : typeof value === "object" ? Object.keys(value).slice(0,6) : value);
[ 'id', 'number', 'title', 'options', 'width', 'height' ]

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

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

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