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

hitotsuCardSvgfunction

A whole card as an SVG document, width pixels wide (140/100 of it tall): a face, or the back for null.

Import it

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

Definition

function hitotsuCardSvg(card: HitotsuCard | null, { width, called, title }?: { width?: number; called?: HitotsuColour; title?: string; }): string

Parameters

NameTypeDescription
cardstring | null

The physical card id; null draws the back where supported.

options (optional){ width?: number; called?: HitotsuColour; title?: string; }

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

Returns

string

The complete SVG document for the card or its back.

Examples

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

console.log(hitotsuCardSvg("R70", { width: 80, title: "Red seven" }).slice(0, 120));
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 140" width="80" height="112" role="img" aria-label="Red seven">

What it prints (run when this page was built)

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