本文へ移動

Sugoroku双六

標準の規則、キューブ、試合の得点、シード付きのサイコロ、再生できる記録で、バックギャモンと仲間のゲームを遊べます。

「双六」は、盤と駒で遊ぶゲームの名前です。 名前について(英語)

目次

リファレンス

遊べる盤面

import { … } from "@johnmorrisdotca/sugoroku/play";

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

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

Sugoroku, played in a page: mountSugoroku draws a game into any element and plays it by touch and mouse, with the doubling cube, Undo, the computer for either side or both, optional sounds, and the words in English and Japanese. A separate entry (@johnmorrisdotca/sugoroku/play), so a server never loads any of it.

エクスポート

名前種類概要
createSounds関数A player for the sounds, which makes its audio only when first asked to play, as browsers insist on a gesture first.
ensureSugorokuPlayStyle関数Put the style in the page once: in the document's head, or in the shadow root the host is in.
mountSugoroku関数Mount a board into host.
packagedSounds関数The sounds' addresses beside the package's code, or an empty set where import.meta.url is not an address (some test runners).
SoundName型THE SOUNDS OF A BOARD, optional: a checker set down, a checker hit, the dice and the cube.
SoundPlayer型Optional board-sound playback and cleanup methods.
SoundUrls型The address of each sound.
SUGOROKU_PLAY_STYLE定数THE STYLE a playable Sugoroku board wears (mountSugoroku, <sugoroku-board>): the drawing's own (SUGOROKU_STYLE), the board's box, its buttons and its lines of words.
SUGOROKU_STRINGS定数The native English and Japanese labels, announcements and interpolation templates.
SugorokuEventDetail型What every event of the board carries.
SugorokuLanguage型THE WORDS A SUGOROKU BOARD SAYS, in English and Japanese: the buttons, the line that says whose turn it is and what to do, and the result of a game.
sugorokuLanguageOf関数The language an element or its page is in: its own lang, or the nearest above, and English unless that begins with ja.
SugorokuLook型How the board looks, apart from the game.
SugorokuMount型The mounted native board, current game/match/record, actions and cleanup handle.
SugorokuMountOptions型Native variant, rules, seed, computer, display, control, sound and event-callback choices.
sugorokuSay関数A line in a language with its {name}s filled in.

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

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