本文へ移動

Sugoroku双六

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

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

目次

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

SugorokuColours型

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

THE COLOURS OF A BOARD. Every colour the drawing uses is one of these, set as a custom property on the drawing (--sg-felt and so on), so a page's own style may change any of them, and drawSugoroku takes any of them as an option. Where a colour is left out the drawing uses the theme's: light by default, dark when the device is (see SUGOROKU_STYLE).

インポート

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

定義

type SugorokuColours = {
    frame: string;
    felt: string;
    pointA: string;
    pointB: string;
    bar: string;
    tray: string;
    white: string;
    whiteEdge: string;
    black: string;
    blackEdge: string;
    number: string;
    selected: string;
    target: string;
    die: string;
    pip: string;
    cube: string;
    cubeInk: string;
};

メンバー

名前型説明
framestring

The frame the board is set in.

feltstring

The playing surface.

pointAstring

The points, alternately.

pointBstring
barstring

The bar, and the trays' floor.

traystring
whitestring

The checkers: the face and the rim of each side's.

whiteEdgestring
blackstring
blackEdgestring
numberstring

The numbers on the points, and a count on a tall stack.

selectedstring

What marks the checker picked up, and the places it may go.

targetstring
diestring

The dice and the cube.

pipstring
cubestring
cubeInkstring

例

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

const value: SugorokuColours = Object.fromEntries(SUGOROKU_COLOUR_NAMES.map(name=>[name,"#ffffff"])) as SugorokuColours;
console.log(value);
{
  frame: '#ffffff',
  felt: '#ffffff',
  pointA: '#ffffff',
  pointB: '#ffffff',
  bar: '#ffffff',
  tray: '#ffffff',
  white: '#ffffff',
  whiteEdge: '#ffffff',
  black: '#ffffff',
  blackEdge: '#ffffff',
  number: '#ffffff',
  selected: '#ffffff',
  target: '#ffffff',
  die: '#ffffff',
  pip: '#ffffff',
  cube: '#ffffff',
  cubeInk: '#ffffff'
}

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

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

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