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
| Name | Type | Description |
|---|---|---|
from | number | The source position or source state specified by this API. |
seats | number | 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));2What it prints (run when this page was built)