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 · Game engine and table

startHitotsufunction

Deal a new seeded game for two to eight players at a supported match length; null for an unsupported length or player count.

Import it

import { startHitotsu } from "@johnmorrisdotca/hitotsu";

Definition

function startHitotsu(size: number, players: readonly string[], seed?: number, options?: HitotsuOptions, computers?: readonly boolean[]): HitotsuGame | null

Parameters

NameTypeDescription
sizenumber

The match length: 1 for one hand, or 200 or 500 points.

playersreadonly string[]

The two to eight player names in seat order.

seed (optional)number

The numeric seed that reproduces the same random sequence or deal.

options (optional)HitotsuOptions

Native table, rules, sound or drawing settings; omitted fields retain their defaults.

computers (optional)readonly boolean[] | undefined

Computer-controlled seats: flags for a game, seat indices for a shared table.

Returns

HitotsuGame | null

Deal a new seeded game for two to eight players at a supported match length; null for an unsupported length or player count.

Examples

import { HITOTSU_CLASSIC, startHitotsu } from "@johnmorrisdotca/hitotsu";

console.log(startHitotsu(1, ["Aki", "Ben"], 42, HITOTSU_CLASSIC)?.hands.map((hand) => hand.length));
[ 7, 7 ]

What it prints (run when this page was built)

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