DiceWarGame型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A game of Dice War: its table, seed and moves (what is kept), and what they make.
インポート
import type { DiceWarGame } from "@johnmorrisdotca/korokoro";
定義
type DiceWarGame = {
players: string[];
computers: boolean[];
dice: number;
sides: number;
goal: DiceWarGoal;
to: number;
seed: string;
moves: DiceWarMove[];
phase: "playing" | "over";
scores: number[];
round: number;
wars: number;
stake: number;
rollers: number[];
throws: DiceWarThrow[];
ended: DiceWarGoal | null;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
players | string[] | |
computers | boolean[] | |
dice | number | |
sides | number | |
goal | DiceWarGoal | |
to | number | |
seed | string | |
moves | DiceWarMove[] | Every move so far, in order. |
phase | "playing" | "over" | |
scores | number[] | Each seat's points. |
round | number | The round being played, from 1; once over, the round it ended in. |
wars | number | How many wars the round has been through. |
stake | number | The points at stake in this round now: 1, and one more for each war. |
rollers | number[] | The seats that roll next: everybody, or in a war those who tied. |
throws | DiceWarThrow[] | Every throw so far, oldest first. |
ended | DiceWarGoal | null | Why the game ended: a player reached the score ( |
例
import type { DiceWarGame } from "@johnmorrisdotca/korokoro";
import { startDiceWar } from "@johnmorrisdotca/korokoro";
const value: DiceWarGame = startDiceWar({ players: ["One", "Two"], computers: [true, true], seed: "docs" })!;
console.log(value.phase);playing出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。