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 · Spider

SpiderTabletype

A game of Spider as it stands: the columns, the cards still to deal, and the runs sent home.

Import it

import type { SpiderTable } from "@johnmorrisdotca/toranpu/spider";

Definition

type SpiderTable = {
    tableau: readonly SpiderColumn[];
    stock: readonly number[];
    done: readonly number[];
};

Members

NameTypeDescription
tableaureadonly SpiderColumn[]

Ten columns.

stockreadonly number[]

The cards still to be dealt, ten at a time, in the order they will be dealt.

donereadonly number[]

The suit of each full run taken off the table, King down to Ace, in the order they were made: eight is a won game.

Examples

import { dealSpider, spiderDealOfSeed, spiderDeckOf } from "@johnmorrisdotca/toranpu/spider";
import type { SpiderTable } from "@johnmorrisdotca/toranpu/spider";

const table = dealSpider(spiderDeckOf(spiderDealOfSeed(42, 1), 1)!);
const value: SpiderTable = table;
console.log(value.stock.length);
50

What it prints (run when this page was built)

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