本文へ移動

Korokoroコロコロ

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

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

目次

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

mountRoller関数

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

Put a dice tray into an element.

One model runs the whole tray: the roll is a pool of dice. Tapping a die button adds one die of that kind to the pool; a chip in the pool takes one away; the number row sets how many of the kind last touched. The dice the tray opens with are a suggestion, not yet anybody's roll, so the first die tapped takes their place: one tap gives a d20, and d20, d4, d4 gives 1d20+2d4. The notation box says the same pool in writing and can be typed into for anything the buttons do not reach.

A tap on the felt throws the pool. Once plain dice have been thrown, a tap on a die holds it and the next throw rolls the rest.

インポート

import { mountRoller } from "@johnmorrisdotca/korokoro";

定義

function mountRoller(target: HTMLElement, options?: RollerOptions): RollerHandle

引数

名前型説明
targetHTMLElement

The HTMLElement that owns the native interface.

options (省略可)RollerOptions

Native settings and callbacks for this mounted interface.

戻り値

RollerHandle

The native mounted handle, including controls and destroy() cleanup.

例

import { mountRoller } from "@johnmorrisdotca/korokoro";
const show = (host: HTMLElement, options: Parameters<typeof mountRoller>[1]) => mountRoller(host, options);
console.log(typeof show); // function
function

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

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

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