本文へ移動

Korokoroコロコロ

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

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

目次

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

CustomFace型

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

One face of a custom die: what it says, what it is worth in a total if it is worth anything, and a colour for it. The words are text and only ever shown as text.

インポート

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

定義

type CustomFace = {
    label: string;
    value?: number;
    colour?: string;
};

メンバー

名前型説明
labelstring

What the face says: 1 to MAX_LABEL characters.

value (省略可)number | undefined

What it adds to a total. Left out of a face that is only words, which adds nothing.

colour (省略可)string | undefined

A colour for the face, as #rgb or #rrggbb. Left out for the tray's own.

例

import type { CustomFace } from "@johnmorrisdotca/korokoro";
const value: CustomFace = { label: "Hit", value: 1, colour: "#2f5d4a" };
console.log(value.label);
Hit

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

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

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