本文へ移動

Sugoroku双六

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

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

目次

リファレンス · 遊べる盤面

SugorokuEventDetail型

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

What every event of the board carries.

インポート

import type { SugorokuEventDetail } from "@johnmorrisdotca/sugoroku/play";

定義

type SugorokuEventDetail = {
    side: Side | null;
    game: GameState;
    match: Match;
    dice?: readonly number[];
    notation?: string;
    move?: Move;
    moves?: readonly Move[];
    action?: "double" | "take" | "drop" | "beaver";
    result?: GameResult;
    record?: string;
};

メンバー

名前型説明
sideSide | null

The side it is about; null for the opening throw.

gameGameState
matchMatch
dice (省略可)readonly number[] | undefined

Dice: for a roll, those rolled; for a turn, the roll played.

notation (省略可)string | undefined

A move in standard notation, or a turn's play.

move (省略可)Move | undefined
moves (省略可)readonly Move[] | undefined
action (省略可)"double" | "take" | "drop" | "beaver" | undefined

What was done to the cube.

result (省略可)GameResult | undefined

The result, for sugoroku-end.

record (省略可)string | undefined

The record of the match so far, for sugoroku-end.

例

import { newGame, newMatch, rollOpening, settingsFor } from "@johnmorrisdotca/sugoroku";
import type { SugorokuEventDetail } from "@johnmorrisdotca/sugoroku/play";

const settings = settingsFor("backgammon",{points:5,cube:true});
const game = rollOpening(newGame(settings),[3,1]);
const match = newMatch(settings);
const value: SugorokuEventDetail = {side:"white",game,match,dice:[3,1]};
console.log(value);
{
  side: 'white',
  game: {
    settings: { variant: [Object], rules: [Object] },
    crawford: false,
    score: [ 0, 0 ],
    position: { points: [Array], bar: [Array], reserve: [Array], off: [Array] },
    turn: 'white',
    phase: 'playing',
    dice: [ 3, 1 ],
    need: [ 3, 1 ],
    plan: [ 3, 1 ],
    moves: [],
    turnStart: { points: [Array], bar: [Array], reserve: [Array], off: [Array] },
    cube: { value: 1, owner: null },
    offeredBy: null,
    turns: [ 0, 0 ],
    opening: [ 3, 1 ],
    result: null
  },
  match: {
    settings: { variant: [Object], rules: [Object] },
    score: [ 0, 0 ],
    results: [],
    crawfordNext: false,
    crawfordPlayed: false,
    over: false,
    winner: null
  },
  dice: [ 3, 1 ]
}

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

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

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