本文へ移動

Houseki宝石

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

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

目次

リファレンス

ジェムスワップ

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

最小化と gzip 圧縮をしたサイズは 21.0 kB(読み込むものをすべて含み、esbuild で計測)

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

エクスポート

名前種類概要
Action型A native player action accepted or rejected according to the current phase and rules.
advanceTicks関数Advances deterministic resolution ticks; wall-clock time is supplied separately by the host.
advanceTime関数Adds explicit host-measured elapsed time.
applyAction関数Applies one recorded player action.
BlackHolePortal型A Gem Swap portal’s cell, remaining capacity, move lifetime and consumed stable ids.
BoardPreset型A named native board geometry; custom dimensions remain a separate option.
BoardShape型A native shaped active-cell layout applied to the row-major board.
CAMPAIGN_CHECKSUM定数The stored Gem Swap campaign content fingerprint.
CAMPAIGN_COUNT定数The number of stored Gem Swap campaign challenges.
CancelToolAction型Clears the current Gem Swap tool preview.
ChallengeRules型Gem Swap authored goals, optional move budget and seal layout.
ConfirmToolAction型Commits the currently selected Gem Swap tool and target.
createGame関数Creates a deterministic stable board with at least one legal normal swap.
CreateOptions型Creation settings for this native engine; dimensions, mode, seed and optional mechanics are validated together.
decodeGame関数Validates and reconstructs a state by replay; serialized board snapshots are never trusted.
encodeGame関数Encodes the initial rules plus accepted actions and logical inputs in canonical JSON.
GameEvent型An event emitted by one native transition; type selects the event’s additional fields.
GameMode型The native free, timed, daily or authored-challenge game mode.
GameOutcome型The terminal outcome; null means the run has no terminal outcome yet.
GamePhase型The native ready, resolution and ending phases.
GameState型The immutable authoritative native game state, including its board, random state and recording.
GameStatus型A compact native status derived from the authoritative state for a host’s labels.
Gem型A gem has a stable identity and stored colour until it is cleared.
GEM_SWAP_CAMPAIGN定数The frozen measured Gem Swap challenges with stable ids, setups, witnesses and review status.
GEM_SWAP_LESSONS定数The frozen bilingual Gem Swap lessons with setup, teaching steps and witnesses.
GemColour型A colour used by a normal gem.
GemSwapCampaignLevel型One authored native challenge with its stable id, setup, winning witness, measurements and review status.
GemSwapLesson型One bilingual native lesson with its authored setup, teaching steps and winning witness.
GemSwapLessonStep型One bilingual native lesson instruction and the corresponding action or tick step.
GemSwapOptionsErrorクラスTyped error for invalid settings or a board that cannot be generated safely.
GemSwapReviewStatus型The existing campaign’s human-review-pending status; an engine witness is not human review.
GENERATION_REVISION定数The stored Gem Swap campaign generation revision.
Goal型The native authored goal; its discriminant selects the required collection or clearing condition.
GRADING_VERSION定数The measurement/normalization revision used to grade Gem Swap challenges.
GRADING_WEIGHTS定数The bounded Gem Swap metric weights used in the recorded grading formula.
HintAction型Requests a native Gem Swap hint and marks assisted play.
hintGame関数Returns a deterministic legal swap hint and permanently marks the run assisted.
legalActions関数Lists all legal swaps that would be accepted from the current stable state.
OrdinaryToolKind型A Gem Swap stored tool excluding the separately charged Black Hole.
PlannedSpecial型The native Gem Swap cell and special kind planned for the end of a clear wave.
ReplayErrorクラスA typed rejection of a malformed, unsupported or inconsistent native replay.
ReplayOperation型One native Gem Swap action, fixed-tick advance or elapsed-time replay operation.
ReshuffleAction型Requests a native Gem Swap recovery shuffle.
reshuffleGame関数Shuffles existing gem records in Relaxed play, preserving their colour and special counts.
restartGame関数Starts the exact initial ruleset and seed again, discarding all run progress.
SAMPLE_BUDGET定数The fixed number of seeded playout samples used in the stored Gem Swap grading.
Seal型A Gem Swap row-major seal cell and its remaining layers.
SelectToolAction型Selects a stored Gem Swap tool without committing its target.
Settings型Validated settings fixed at native game creation.
SpecialKind型A Gem Swap beam, bomb or colour-burst special retained at its chosen anchor.
statusOf関数Derive the native phase, score, legal-move count, tools and goal/timer progress for host labels.
SwapAction型Swaps two row-major cell addresses.
TargetToolAction型Previews a selected Gem Swap tool on one row-major cell.
ToolInventory型The native remaining counts of stored tools.
ToolKind型A Gem Swap stored tool or advanced Black Hole selection.
Transition型The resulting native state, emitted events and acceptance decision; rejected actions preserve the input.
UndoAction型Requests restoration of the prior Gem Swap move.
undoGame関数Restores the last committed swap in Relaxed or Challenge play and marks assistance.
validateChallengeWitness関数Checks a complete authored witness through the public deterministic rules API.

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

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