ginComputerfunction
The move a computer in the seat to play makes: always one the rules allow.
Import it
import { ginComputer } from "@johnmorrisdotca/toranpu/gin-rummy";
Definition
function ginComputer(game: GinGame): GinMove
Parameters
| Name | Type | Description |
|---|---|---|
game | GinGame | The current native game; applying a move returns a new state. |
Returns
GinMove
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 { ginComputer } from "@johnmorrisdotca/toranpu/gin-rummy";
const names = Array.from({ length: CARD_GAME_TABLES.ginRummy.defaultPlayers }, (_, seat) => `Seat ${seat + 1}`);
let game = newGame("ginRummy", { players: names, seed: 42 })!;
console.log(ginComputer(game));{ draw: 'stock' }What it prints (run when this page was built)