本文へ移動

Hitotsu一つ

色か数字をそろえて出し、手札が1枚になったら声をかけます。クラシックやパーティーのルールで、コンピューターや共有のテーブルで遊べます。

「ヒトツ」は「一つ」。手札が1枚になったときに言う言葉です。 名前について(英語)

目次

リファレンス · ゲームとテーブル

HitotsuTableOptions型

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

Native table settings, including private player names and callbacks.

インポート

import type { HitotsuTableOptions } from "@johnmorrisdotca/hitotsu";

定義

type HitotsuTableOptions = {
    players?: readonly string[];
    computers?: number;
    rules?: HitotsuOptions;
    size?: number;
    seed?: number;
    language?: HitotsuLanguage;
    strings?: Partial<HitotsuStrings>;
    computerMs?: number;
    theme?: Record<`--ht-${string}`, string>;
    sound?: boolean | CardSounds;
    onMove?: (game: HitotsuGame) => void;
};

メンバー

名前型説明
players (省略可)readonly string[] | undefined

Everybody at the table, seat 0 first: seat 0 is the person at this screen, the rest computers. Two to eight; four by default.

computers (省略可)number | undefined

Number of computer seats when names are omitted, 1–7; three by default.

rules (省略可)HitotsuOptions | undefined

The house rules: HITOTSU_CLASSIC (the default), HITOTSU_PARTY, or any mix.

size (省略可)number | undefined

What wins: 200 or 500 points, or 1 for a single hand (the default).

seed (省略可)number | undefined

The seed the deals are shuffled from; a fresh one if not given.

language (省略可)HitotsuLanguage | undefined

The language of the table's words, "en" or "ja". The page's own (lang on the element or an ancestor, or on the document) unless said.

strings (省略可)Partial<HitotsuStrings> | undefined

Words to use instead of the built-in ones, over whichever language is in use.

computerMs (省略可)number | undefined

How long a computer thinks before it plays, in milliseconds. Long enough to jump in, where the table plays jump-in.

theme (省略可)Record<`--ht-${string}`, string> | undefined

CSS variables for the table, such as { "--ht-felt": "#234" }.

sound (省略可)boolean | CardSounds | undefined

Card sounds: true for the package's own (cards dealt, played, shuffled; Kenney's Casino Audio, CC0), or a createCardSounds() of your own. Off unless asked; nothing is fetched until the first sound.

onMove (省略可)((game: HitotsuGame) => void) | undefined

Called after every move, with the game it made.

例

import type { HitotsuTableOptions } from "@johnmorrisdotca/hitotsu";
const options: HitotsuTableOptions = { seed: 42, size: 200 };
console.log(options.size);
200

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

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

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