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

hitotsuViewfunction

One seat’s hand and legal choices, with public counts and the current colour, for a computer player.

Import it

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

Definition

function hitotsuView(game: HitotsuGame, seat?: number): HitotsuView

Parameters

NameTypeDescription
gameHitotsuGame

The current native game; it is left unchanged.

seat (optional)number

The zero-based seat whose choices are requested.

Returns

HitotsuView

One seat’s hand and legal choices, with public counts and the current colour, for a computer player.

Examples

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

const game = startHitotsu(1, ["Aki", "Ben"], 42, HITOTSU_CLASSIC, [true, true])!;
console.log(hitotsuView(game, 0));
{
  seat: 0,
  hand: [
    'R31', 'R50',
    'YD0', 'G00',
    'G61', 'BD0',
    'WF2'
  ],
  counts: [ 7, 7 ],
  colour: 'Y',
  next: 1,
  drawn: null,
  challengeFrom: null,
  legal: [
    { play: 'YD0' },
    { play: 'WF2', colour: 'R' },
    { play: 'WF2', colour: 'Y' },
    { play: 'WF2', colour: 'G' },
    { play: 'WF2', colour: 'B' },
    { draw: true }
  ]
}

What it prints (run when this page was built)

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