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 · Big Two

nextRoundfunction

The next seat round from from (not counting it) that wanted accepts, or null when none does.

Import it

import { nextRound } from "@johnmorrisdotca/toranpu/big-two";

Also exported from: @johnmorrisdotca/toranpu/president

Definition

function nextRound(from: number, seats: number, wanted: (seat: number) => boolean): number | null

Parameters

NameTypeDescription
fromnumber

The source position or source state specified by this API.

seatsnumber

The seat count or seat state supplied by this API.

wanted(seat: number) => boolean

A predicate that says which seat may be selected next.

Returns

number | null

The next seat round from from (not counting it) that wanted accepts, or null when none does.

Examples

import { nextRound } from "@johnmorrisdotca/toranpu/big-two";

console.log(nextRound(0, 4, (seat) => seat === 2));
2

What it prints (run when this page was built)

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