本文へ移動

Houseki宝石

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

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

目次

リファレンス

自然と嵐の環境

import { … } from "@johnmorrisdotca/houseki/nature";

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

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

エクスポート

名前種類概要
applyEarthquake関数Commit one bounded environmental resolution; matching, gravity and score remain the host game's job.
applyLightning関数Commit one lightning strike.
applyMagneticPulse関数Apply one attraction pulse.
applyPowerDrop関数Commit a previewed landing as one immutable operation.
AttractionPairPreview型A pure attraction decision including the paired ids, axis, gap, midpoint and moves.
createNatureState関数Create a validated seeded native environment grid with fixed masks and mechanic switches.
EarthquakeKind型The native fault, jumble or combined earthquake mode.
EarthquakeOptions型The earthquake mode and optional enabled flag.
EnvironmentEvent型A committed earthquake or lightning event with its native preview fields.
EnvironmentPreview型A native earthquake or lightning preview before it is committed.
EnvironmentSchedule型A periodic, one-turn or authored list of environment trigger turns.
EnvironmentTransition型The committed environment state, event list and pure preview.
FaultPreview型A pure earthquake fault path, removed ids and resulting occupants/passability mask.
HorizontalDirection型The native left or right direction used for rebound decisions.
isEnvironmentTurnScheduled関数Pure one-based schedule lookup: frequent is every second turn; rare is every eighth turn.
JumblePreview型A pure eligible-patch shuffle and resulting occupants; reason explains when no patch exists.
LightningOptions型Lightning enablement and explicit columns or a bounded column count.
LightningPreview型A pure selected-column removal and resulting occupants/random state.
MagneticPreview型A pure magnetic-pulse result; no input state or random source is consumed.
MarkingOptions型The probability and optional count/anchor bounds used to mark magnetic stones.
markMagneticStones関数Deterministically assign magnetic markings to settled stones without changing their IDs or colours.
NatureEntity型Stable board occupant.
NatureErrorCode型Stable native validation codes for grid, cell, marking and power-drop failures.
NatureEvent型An emitted native magnetic marking, attraction or power-drop event.
NatureMove型One native stable-id move between two board coordinates.
NatureOptions型The native grid dimensions, passability mask, occupants, seed and magnetic/rebound settings.
NatureOptionsErrorクラスA typed native grid, cell, marking or power-drop validation error.
NaturePieceCell型A falling native stone with its cell coordinates and stable id.
NatureRules型The fixed native magnetic and rebound rule switches.
NatureState型The immutable native environment state with stable ids, seeded random state and placement count.
NatureTransition型The native environment result, emitted events and optional pure preview.
PowerDropPreview型The pure normal landing, rebound attempts and final lock cells with resulting random state.
PowerDropRequest型The native piece cells, pivot id and host-selected power/rebound options.
previewEarthquake関数Preview an earthquake, with Combined always fracturing before its one jumble attempt.
previewFault関数Preview a bounded top-to-bottom fracture.
previewJumble関数Preview one seeded, nontrivial stone permutation inside a fully active connected rectangle no larger than 3×3.
previewLightning関数Preview seeded or explicitly selected columns; a mask gap or obstacle blocks the strike below it.
previewMagneticPulse関数Preview one bounded deterministic attraction pulse without mutating the state.
previewPowerDrop関数Preview a single normal landing and, for a power drop, at most one validated one-cell rebound.
QuarterTurn型A counterclockwise, unchanged or clockwise quarter-turn chosen by the host.
ReboundAttemptPreview型One tested rebound direction and quarter-turn with its collision-validity result.
ReboundDirectionMode型Whether rebound prefers recent input/alternation or the seeded random source.

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

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