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
| Name | Type | Description |
|---|---|---|
size | number | The match length: 1 for one hand, or 200 or 500 points. |
players | readonly 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)