goban-engine
Version:
This contains the built Go engine that is used by the Goban package. There are no display components in this package, only the logic for playing the game of Go, making it suitable for usage in node.js or other server-side environments.
15 lines (14 loc) • 920 B
TypeScript
import { type MoveTree } from "../MoveTree";
import { JGOFMove, AdHocPackedMove } from "../formats";
/**
* Decodes any of the various ways we express moves that we've accumulated over the years into
* a unified `JGOFMove[]`.
*/
export declare function decodeMoves(move_obj: string | AdHocPackedMove | AdHocPackedMove[] | JGOFMove | JGOFMove[] | [object] | undefined, width: number, height: number): JGOFMove[];
export declare function char2num(ch: string): number;
export declare function num2char(num: number): string;
export declare function encodeMove(x: number | JGOFMove | MoveTree, y?: number): string;
export declare function encodeMoves(lst: JGOFMove[]): string;
export declare function encodeMoveToArray(mv: JGOFMove): AdHocPackedMove;
export declare function encodeMovesToArray(moves: Array<JGOFMove>): Array<AdHocPackedMove>;
export declare function ojeSequenceToMoves(sequence: string): Array<JGOFMove>;