presidentComputerfunction
The move a computer in the seat to play makes: always one the rules allow.
Import it
import { presidentComputer } from "@johnmorrisdotca/toranpu/president";
Definition
function presidentComputer(game: PresidentGame): PresidentMove
Parameters
| Name | Type | Description |
|---|---|---|
game | PresidentGame | The current native game; applying a move returns a new state. |
Returns
PresidentMove
The move a computer in the seat to play makes: always one the rules allow.
Examples
import { CARD_GAME_TABLES, newGame } from "@johnmorrisdotca/toranpu";
import { presidentComputer } 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(presidentComputer(game));{ play: [ '3C' ] }What it prints (run when this page was built)