import type { CardId } from "../card-games.types.ts"; import type { ClimbMove, ClimbPlay } from "../climbing/climbing.types.ts"; import type { BigTwoGame } from "./big-two.types.ts"; /** * A COMPUTER AT THE BIG TWO TABLE, playing as a sensible player does: lead * the play that sheds the most low cards (a run from the bottom of the hand * before a lone three), beat the table as cheaply as it can without breaking * up a pair or a triple it could play whole, and keep its aces and twos back * until somebody is close to going out or its own hand is nearly gone. When a * player is down to one card it stops leading singles they could beat. * * It reads a view of the game (`bigTwoView`): its own hand, what is on the * table, how many cards each player holds, and nothing else. */ /** What one seat can see of a game of Big Two: its own hand, the table, and what has been said and shown. * * @example * ```ts * import { CARD_GAME_TABLES, newGame } from "@johnmorrisdotca/toranpu"; * import type { BigTwoView } from "@johnmorrisdotca/toranpu/big-two"; * import { bigTwoView } from "@johnmorrisdotca/toranpu/big-two"; * * const names = Array.from({ length: CARD_GAME_TABLES.bigTwo.defaultPlayers }, (_, seat) => `Seat ${seat + 1}`); * const game = newGame("bigTwo", { players: names, seed: 42 })!; * const value: BigTwoView = bigTwoView(game); * console.log(value.hand.length); * ``` */ export type BigTwoView = { seat: number; hand: readonly CardId[]; pile: ClimbPlay | null; /** How many cards each seat holds: counted in the open at any table. */ counts: readonly number[]; legal: readonly ClimbMove[]; }; /** The part of the game the seat to play can see, which is all its computer is given. * * @param game - The current native game; applying a move returns a new state. * @returns The part of the game the seat to play can see, which is all its computer is given. * * @example * ```ts * import { CARD_GAME_TABLES, newGame } from "@johnmorrisdotca/toranpu"; * import { bigTwoView } from "@johnmorrisdotca/toranpu/big-two"; * * const names = Array.from({ length: CARD_GAME_TABLES.bigTwo.defaultPlayers }, (_, seat) => `Seat ${seat + 1}`); * let game = newGame("bigTwo", { players: names, seed: 42 })!; * console.log(bigTwoView(game)); * ``` */ export declare function bigTwoView(game: BigTwoGame): BigTwoView; /** The move a computer in the seat to play makes: always one the rules allow. * * @param game - The current native game; applying a move returns a new state. * @returns The move a computer in the seat to play makes: always one the rules allow. * * @example * ```ts * import { CARD_GAME_TABLES, newGame } from "@johnmorrisdotca/toranpu"; * import { bigTwoComputer } from "@johnmorrisdotca/toranpu/big-two"; * * const names = Array.from({ length: CARD_GAME_TABLES.bigTwo.defaultPlayers }, (_, seat) => `Seat ${seat + 1}`); * let game = newGame("bigTwo", { players: names, seed: 42 })!; * console.log(bigTwoComputer(game)); * ``` */ export declare function bigTwoComputer(game: BigTwoGame): ClimbMove;