Skip to the content

Toranpuトランプ

Use a deck, play eleven games with computers, solve a solitaire, or display cards in your own design.

Toranpu is Japanese for playing cards. About the name

Contents

Reference · Deck tools

Randomtype

A number in [0, 1), like Math.random, from a stream a seed fixes.

Import it

import type { Random } from "@johnmorrisdotca/toranpu/deck";

Also exported from: @johnmorrisdotca/toranpu

Definition

type Random = () => number;

Examples

import type { Random } from "@johnmorrisdotca/toranpu/deck";
import { seededRandom } from "@johnmorrisdotca/toranpu/deck";

const value: Random = seededRandom(42);
console.log(value());
0.6011037519201636

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/toranpu 2.15.0.