Reference · Game engine and table
movesForfunction
Everything this seat may do now: its own turn's moves, or, at another's turn, the cards it may jump in with.
Import it
import { movesFor } from "@johnmorrisdotca/hitotsu";
Definition
function movesFor(game: HitotsuGame, seat: number): HitotsuMove[]
Parameters
| Name | Type | Description |
|---|---|---|
game | HitotsuGame | The current native game; it is left unchanged. |
seat | number | The zero-based seat whose choices are requested. |
Returns
HitotsuMove[]
Everything this seat may do now: its own turn's moves, or, at another's turn, the cards it may jump in with.
Examples
import { HITOTSU_CLASSIC, movesFor, startHitotsu } from "@johnmorrisdotca/hitotsu";
const game = startHitotsu(1, ["Aki", "Ben"], 42, HITOTSU_CLASSIC, [true, true])!;
console.log(movesFor(game, 0));[
{ play: 'YD0' },
{ play: 'WF2', colour: 'R' },
{ play: 'WF2', colour: 'Y' },
{ play: 'WF2', colour: 'G' },
{ play: 'WF2', colour: 'B' },
{ draw: true }
]What it prints (run when this page was built)