import type { SpiderMove, SpiderTable } from "./spider.types.ts"; /** * A SPIDER GAME WRITTEN DOWN: the deal and the moves, as Solitaire's are * (`solitaire/code.ts`). The deal is both decks in the order they are dealt, * one letter a card, a hundred and four letters (the same letter twice, or * eight times with one suit). A move is `d` for a deal from the stock, or * three characters: the column it leaves, the column it lands on, and how many * cards it carries, `1`–`9` then `a`–`d` for ten to thirteen (base 36), since * into an empty column any number up to the run would do. */ /** The letter dealing a card to every column is written as, in a move list. * * @example * ```ts * import { DEAL_CODE } from "@johnmorrisdotca/toranpu/spider"; * console.log(DEAL_CODE); * ``` */ export declare const DEAL_CODE = "d"; /** One move written as text: one or two letters. * * @param move - The native move to validate or apply. * @returns One move written as text: one or two letters. * * @example * ```ts * import { encodeMove } from "@johnmorrisdotca/toranpu/spider"; * * console.log(encodeMove({ kind: "deal" })); * ``` */ export declare function encodeMove(move: SpiderMove): string; /** A list of moves written as text, one after another with nothing between. * * @param moves - The ordered native moves to replay. * @returns A list of moves written as text, one after another with nothing between. * * @example * ```ts * import { encodeMoves } from "@johnmorrisdotca/toranpu/spider"; * * console.log(encodeMoves([{ kind: "deal" }])); * ``` */ export declare function encodeMoves(moves: readonly SpiderMove[]): string; /** A move list read back, or null for one with a character that is no move. * * @param code - The encoded card or game state. * @returns A move list read back, or null for one with a character that is no move. * * @example * ```ts * import { decodeMoves, encodeMoves } from "@johnmorrisdotca/toranpu/spider"; * * console.log(decodeMoves(encodeMoves([{ kind: "deal" }]))); * ``` */ export declare function decodeMoves(code: string): SpiderMove[] | null; /** The deal of a seed at so many suits: the site's one shuffle (`shuffled`) of both decks, written down. * * @param seed - The numeric seed that reproduces the same shuffle or deal. * @param suits - The allowed suits. * @returns The deal of a seed at so many suits: the site's one shuffle (`shuffled`) of both decks, written down. * * @example * ```ts * import { spiderDealOfSeed } from "@johnmorrisdotca/toranpu/spider"; * * console.log(spiderDealOfSeed(42, 1)); * ``` */ export declare function spiderDealOfSeed(seed: number, suits: number): string; /** The cards a deal string names, or null for one that is not both decks of a game of so many suits. * * @param deal - The deal number or dealing specification. * @param suits - The allowed suits. * @returns The cards a deal string names, or null for one that is not both decks of a game of so many suits. * * @example * ```ts * import { spiderDealOfSeed, spiderDeckOf } from "@johnmorrisdotca/toranpu/spider"; * * console.log(spiderDeckOf(spiderDealOfSeed(42, 1), 1)?.length); * ``` */ export declare function spiderDeckOf(deal: string, suits: number): number[] | null; /** * A game played out from its deal: every table it passed through, the first * the deal, or null where the deal is not two decks or a move is one the rules * refuse. The one reader of a move list, for the table, a kept run, the check * and a finished game's page alike. * * @param deal - The deal number or dealing specification. * @param suits - The allowed suits. * @param moves - The ordered native moves to replay. * @returns A game played out from its deal: every table it passed through, the first the deal, or null where the deal is not two decks or a move is one the rules refuse. The one reader of a move list, for the table, a kept run, the check and a finished game's page alike. * * @example * ```ts * import { encodeMoves, replaySpider, spiderDealOfSeed } from "@johnmorrisdotca/toranpu/spider"; * * console.log(replaySpider(spiderDealOfSeed(42, 1), 1, encodeMoves([{ kind: "deal" }]))?.length); * ``` */ export declare function replaySpider(deal: string, suits: number, moves: string): SpiderTable[] | null;