import type { CardId } from "../card-games.types.ts"; import type { ClimbMove } from "../climbing/climbing.types.ts"; import type { BigTwoGame } from "./big-two.types.ts"; /** A new game of Big Two for these players (one name a seat) at this size, dealt from the seed `dealt`, or null for a table Big Two is not offered for. `computers` says, one a seat, which seats a computer plays; the third argument is unused. * * @param size - The game’s length or size, as defined by its table specification. * @param players - The player names in seat order. * @param _language - An unused legacy language argument retained for compatibility. * @param dealt - The numeric seed used to deal the game. * @param computers - Flags by seat: true where a computer controls that seat. * @returns A new game of Big Two for these players (one name a seat) at this size, dealt from the seed `dealt`, or null for a table Big Two is not offered for. `computers` says, one a seat, which seats a computer plays; the third argument is unused. * * @example * ```ts * import { CARD_GAME_TABLES } from "@johnmorrisdotca/toranpu"; * import { startBigTwo } from "@johnmorrisdotca/toranpu/big-two"; * * const names = Array.from({ length: CARD_GAME_TABLES.bigTwo.defaultPlayers }, (_, seat) => `Seat ${seat + 1}`); * console.log(startBigTwo(CARD_GAME_TABLES.bigTwo.defaultSize, names, undefined, 42)?.phase); * ``` */ export declare function startBigTwo(size: number, players: readonly string[], _language?: unknown, dealt?: number, computers?: readonly boolean[]): BigTwoGame | null; /** Whether these cards may be played now by the seat to play. * * @param game - The current native game; applying a move returns a new state. * @param cards - The cards in their current order. * @returns Whether these cards may be played now by the seat to play. * * @example * ```ts * import { CARD_GAME_TABLES, newGame } from "@johnmorrisdotca/toranpu"; * import { bigTwoMayPlay } 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(bigTwoMayPlay(game, [game.opening!])); * ``` */ export declare function bigTwoMayPlay(game: BigTwoGame, cards: readonly CardId[]): boolean; /** Every move the seat to play may make now; none once the game is over. * * @param game - The current native game; applying a move returns a new state. * @returns Every move the seat to play may make now; none once the game is over. * * @example * ```ts * import { CARD_GAME_TABLES, newGame } from "@johnmorrisdotca/toranpu"; * import { bigTwoMoves } 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(bigTwoMoves(game)); * ``` */ export declare function bigTwoMoves(game: BigTwoGame): ClimbMove[]; /** What a hand left in is charged when somebody goes out: a point a card, double for ten or more, treble for thirteen or more. * * @param left - The remaining hand or the first comparison value. * @returns What a hand left in is charged when somebody goes out: a point a card, double for ten or more, treble for thirteen or more. * * @example * ```ts * import { bigTwoCharge } from "@johnmorrisdotca/toranpu/big-two"; * * console.log(bigTwoCharge(13)); * ``` */ export declare function bigTwoCharge(left: number): number; /** The game after that move, with the move added to its record, or null for a move the rules refuse. * * @param game - The current native game; applying a move returns a new state. * @param move - The native move to validate or apply. * @returns The game after that move, with the move added to its record, or null for a move the rules refuse. * * @example * ```ts * import { CARD_GAME_TABLES, newGame, rulesFor } from "@johnmorrisdotca/toranpu"; * import { playBigTwo } 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(playBigTwo(game, rulesFor("bigTwo").moves(game)[0]!)?.moves.length); * ``` */ export declare function playBigTwo(game: BigTwoGame, move: ClimbMove): BigTwoGame | null; /** The fewest penalty points wins; level on the fewest shares it. * * @param game - The current native game; applying a move returns a new state. * @returns The fewest penalty points wins; level on the fewest shares it. * * @example * ```ts * import { CARD_GAME_TABLES, newGame } from "@johnmorrisdotca/toranpu"; * import { bigTwoWinners } 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(bigTwoWinners(game)); * ``` */ export declare function bigTwoWinners(game: BigTwoGame): number[];