Skip to the content

Hitotsu一つ

Match the colour or number, call with one card left, and play classic or party rules against computers or at a shared table.

Hitotsu is Japanese for one: the call with one card left. About the name

Contents

Reference · Table element

HitotsuElementOptionstype

Host-only settings, including custom house rules and private names.

Import it

import type { HitotsuElementOptions } from "@johnmorrisdotca/hitotsu/element";

Also exported from: @johnmorrisdotca/hitotsu/element/define, @johnmorrisdotca/hitotsu/element-define

Definition

type HitotsuElementOptions = HitotsuTableOptions;

Members

NameTypeDescription
players (optional)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 (optional)number | undefined

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

rules (optional)HitotsuOptions | undefined

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

size (optional)number | undefined

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

seed (optional)number | undefined

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

language (optional)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 (optional)Partial<HitotsuStrings> | undefined

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

computerMs (optional)number | undefined

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

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

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

sound (optional)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 (optional)((game: HitotsuGame) => void) | undefined

Called after every move, with the game it made.

Examples

import type { HitotsuElementOptions } from "@johnmorrisdotca/hitotsu/element";
const options: HitotsuElementOptions = { seed: 42 };
console.log(options.seed);
42

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/hitotsu 1.4.0.