本文へ移動

Sugoroku双六

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

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

目次

リファレンス · 規則・ゲーム・記録

VariantSpec型

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

A native variant’s checker counts, starting layout, dice, directions, opening and winning goal.

インポート

import type { VariantSpec } from "@johnmorrisdotca/sugoroku";

定義

type VariantSpec = {
    readonly key: VariantKey;
    readonly checkers: number;
    readonly layout: readonly (readonly [
        number,
        number
    ])[];
    readonly dice: 2 | 3;
    readonly doubles: "four" | "none";
    readonly direction: Direction;
    readonly opening: Opening;
    readonly goal: Goal;
    readonly holdBelow: number;
    readonly drawAfter: number;
};

メンバー

名前型説明
keyVariantKey
checkersnumber

Checkers each side has.

layoutreadonly (readonly [number, number])[]

Where the checkers are at the start, as [own point, how many]. Empty for a start with every checker off the board.

dice2 | 3

How many dice a roll is: two, or three for Tabula.

doubles"four" | "none"

Whether doubles are played four times (four) or are an ordinary roll (none).

directionDirection
openingOpening
goalGoal
holdBelownumber

While any checker is still to enter the board, no checker may land on this own point or any below it. 0 for no such rule. Tabula holds every checker in the first half until all fifteen are in.

drawAfternumber

A game that reaches this many turns for each side is a draw. 0 for no limit.

例

import { settingsFor } from "@johnmorrisdotca/sugoroku";
import type { VariantSpec } from "@johnmorrisdotca/sugoroku";

const settings = settingsFor("backgammon",{points:5,cube:true});
const spec = settings.variant;
const value: VariantSpec = spec;
console.log(value);
{
  checkers: 15,
  dice: 2,
  doubles: 'four',
  direction: 'opposed',
  opening: 'roll-off',
  goal: 'first-off',
  holdBelow: 0,
  drawAfter: 0,
  key: 'backgammon',
  layout: [ [ 24, 2 ], [ 13, 5 ], [ 8, 3 ], [ 6, 5 ] ]
}

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

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

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