本文へ移動

Korokoroコロコロ

ダイスを組み合わせて振り、ダイス表記を読み取り、正確な確率を調べます。履歴の保存やシードを指定した再現もできます。

「コロコロ」は、小さなものが転がる様子を表す言葉です。 名前について(英語)

目次

リファレンス · ロールと正確な確率

Preset型

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

The dice for a game, and how the game reads them. A preset is data: a line here, not code. Korokoro rolls and reads the dice; it does not run the game (whose turn it is, a score sheet across rounds).

インポート

import type { Preset } from "@johnmorrisdotca/korokoro";

定義

type Preset = {
    id: string;
    name: string;
    nameJa: string;
    aliases: string[];
    family: GameFamily;
    notation: string;
    reading: ReadingId;
    options?: Record<string, number>;
    total: boolean;
    rolls?: number;
    hold?: false;
    runs?: true;
    says: string;
    saysJa: string;
    how: string;
    source?: string;
};

メンバー

名前型説明
idstring

A short name for code, links and the command line: "yahtzee", "cho-han".

namestring

What people call the game.

nameJastring

The same in Japanese, for the tray.

aliasesstring[]

Other names it is found by: an older or public-domain name, a name in another language.

familyGameFamily
notationstring

The dice, as notation.

reading"successes" | "faces" | "sum" | "doubles" | "robber" | "backgammon" | "sixAgain" | "cowries" | "craps" | "hazard" | "yahtzee" | "pokerDice" | "farkle" | "scores" | "bunco" | "pig" | "counts" | "shipCaptainCrew" | "shutTheBox" | "mexico" | "sicBo" | "choHan" | "chinchirorin" | "risk" | "highest" | "d20" | "fate" | "bladesPool" | "pbta" | "hitsAndGlitch" | "percentile" | "rollUnder" | "d66"

How a roll is read: one of the named readings.

options (省略可)Record<string, number> | undefined

Figures a reading needs: a pool's target number, a game's main.

totalboolean

Whether the total is what matters. False where the reading is the result, as in Yahtzee or chō-han.

rolls (省略可)number | undefined

How many rolls a turn has when dice are held between them: 3 for Yahtzee. Left out when a turn is one roll.

hold (省略可)false | undefined

False where holding a die and rolling the rest is no part of the game, as in craps or Monopoly: the tray then holds nothing. Left out where dice are held between rolls (Yahtzee, Farkle).

runs (省略可)true | undefined

True where a roll is read in the light of the rolls before it: the point in craps, a turn's total in Pig.

saysstring

What it is, in a line.

saysJastring

The same in Japanese.

howstring

How the dice are used in the game, in a few sentences of our own.

source (省略可)string | undefined

Where the rule can be read. Left out of a preset that has no rule to cite, such as a coin.

例

import type { Preset } from "@johnmorrisdotca/korokoro";
import { getPreset } from "@johnmorrisdotca/korokoro";
const value: Preset = getPreset("cho-han")!;
console.log(value.notation);
2d6

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

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

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