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

shuffledfunction

A shuffled copy (Fisher–Yates); the list given is left as it was.

Import it

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

Definition

function shuffled<T>(items: readonly T[], random: Random): T[]

Parameters

NameTypeDescription
itemsreadonly T[]

The items to shuffle, leaving the input order intact.

randomRandom

A source of numbers in [0, 1).

Returns

T[]

A shuffled copy (Fisher–Yates); the list given is left as it was.

Examples

import { seededRandom, shuffled } from "@johnmorrisdotca/hitotsu";

console.log(shuffled(["A", "B", "C"], seededRandom(42)));
[ 'C', 'A', 'B' ]

What it prints (run when this page was built)

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