本文へ移動

Sugoroku双六

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

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

目次

リファレンス · SVG盤面と表記

SugorokuDrawOptions型

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

What to draw with.

インポート

import type { SugorokuDrawOptions } from "@johnmorrisdotca/sugoroku/draw";

定義

type SugorokuDrawOptions = {
    variant?: VariantKey | VariantSpec;
    view?: Side;
    home?: "left" | "right";
    orientation?: Orientation;
    numbers?: boolean;
    board?: SugorokuBoardName;
    checkers?: SugorokuCheckerSetName;
    colours?: Partial<SugorokuColours>;
    theme?: "auto" | "light" | "dark";
    dice?: {
        side: Side;
        values: readonly number[];
        spent?: readonly boolean[];
    } | null;
    cube?: {
        value: number;
        owner: Side | null;
    } | null;
    highlight?: {
        side: Side;
        from?: number | null;
        targets?: readonly number[];
        movable?: readonly number[];
    } | null;
    label?: string;
    style?: boolean;
};

メンバー

名前型説明
variant (省略可)VariantKey | VariantSpec | undefined

The variant, for how its sides' points line up. Default backgammon.

view (省略可)Side | undefined

Whose home board is at the bottom of the drawing. Default white.

home (省略可)"left" | "right" | undefined

Which end of the board the trays are at. Default right.

orientation (省略可)Orientation | undefined

Lying across the page (default) or standing up, a better shape for a phone.

numbers (省略可)boolean | undefined

Put the numbers of the points beside them, counted for the side view names. Default off.

board (省略可)SugorokuBoardName | undefined

A named board, whose surfaces are used; colours is laid over it. Left out, the theme's own.

checkers (省略可)SugorokuCheckerSetName | undefined

A named pair of checkers. Left out, the theme's own.

colours (省略可)Partial<SugorokuColours> | undefined

Any colours to use instead, each a CSS colour.

theme (省略可)"auto" | "light" | "dark" | undefined

light or dark to force the theme; auto (the default) follows the device.

dice (省略可){ side: Side; values: readonly number[]; spent?: readonly boolean[]; } | null | undefined

The dice rolled: white's are shown on its half of the board, black's on the other.

cube (省略可){ value: number; owner: Side | null; } | null | undefined

The doubling cube, or null (the default) for a game without one, which then has no rail for it.

highlight (省略可){ side: Side; from?: number | null; targets?: readonly number[]; movable?: readonly number[]; } | null | undefined

The checker picked up and where it may go, in side's own numbering: from a point or the bar (25), the points (or 0 for off) it may land on, and the points (or the bar) a checker could be picked up from.

label (省略可)string | undefined

A description for screen readers.

style (省略可)boolean | undefined

Put SUGOROKU_STYLE inside the drawing, so it stands alone as an image. A page with the style in already leaves this off.

例

import type { SugorokuDrawOptions } from "@johnmorrisdotca/sugoroku/draw";

const value: SugorokuDrawOptions = {variant:"backgammon",view:"white",numbers:true};
console.log(value);
{ variant: 'backgammon', view: 'white', numbers: true }

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

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

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