presidentMovesfunction
Every move the seat to play may make now; none once the game is over.
Import it
import { presidentMoves } from "@johnmorrisdotca/toranpu/president";
Definition
function presidentMoves(game: PresidentGame): PresidentMove[]
Parameters
| Name | Type | Description |
|---|---|---|
game | PresidentGame | The current native game; applying a move returns a new state. |
Returns
PresidentMove[]
Every move the seat to play may make now; none once the game is over.
Examples
import { CARD_GAME_TABLES, newGame } from "@johnmorrisdotca/toranpu";
import { presidentMoves } from "@johnmorrisdotca/toranpu/president";
const names = Array.from({ length: CARD_GAME_TABLES.president.defaultPlayers }, (_, seat) => `Seat ${seat + 1}`);
let game = newGame("president", { players: names, seed: 42 })!;
console.log(presidentMoves(game));[
{ play: [ '3C' ] },
{ play: [ '5H' ] },
{ play: [ '7C' ] },
{ play: [ '8H' ] },
{ play: [ 'JS' ] },
{ play: [ 'QC' ] },
{ play: [ 'QC', 'QD' ] },
{ play: [ 'QC', 'QD', 'QS' ] },
{ play: [ 'KC' ] },
{ play: [ 'KC', 'KH' ] },
{ play: [ 'AS' ] },
{ play: [ '2C' ] },
{ play: [ '2C', '2S' ] }
]What it prints (run when this page was built)