本文へ移動

Korokoroコロコロ

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

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

目次

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

DiceWarOptions型

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

What a game of Dice War is set up with. Everything but the players is optional.

インポート

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

定義

type DiceWarOptions = {
    players: readonly string[];
    computers?: readonly boolean[];
    dice?: number;
    sides?: number;
    goal?: DiceWarGoal;
    to?: number;
    seed?: string;
};

メンバー

名前型説明
playersreadonly string[]

One name a seat. Two to eight.

computers (省略可)readonly boolean[] | undefined

One a seat: true where a computer rolls. A seat not given is a person's, whose dice are handed in.

dice (省略可)number | undefined

How many dice each player rolls, added up: 1 unless said, up to DICE_WAR_LIMITS.mostDice.

sides (省略可)number | undefined

How many sides each die has, 2 to 1000: 6 unless said.

goal (省略可)DiceWarGoal | undefined

"points", played to a score (unless said), or "rounds", played for a number of rounds.

to (省略可)number | undefined

The score to play to, or the number of rounds: 5 unless said.

seed (省略可)string | undefined

The seed the computers' dice come from, any text: a fresh one unless said.

例

import type { DiceWarOptions } from "@johnmorrisdotca/korokoro";
const value: DiceWarOptions = { players: ["One", "Two"], computers: [true, true], seed: "docs" };
console.log(value.players.length);
2

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

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

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