UNPKG

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.

14 lines (13 loc) 724 B
export type Matrix<T> = T[][]; export type NumberMatrix = Matrix<number>; export type StringMatrix = Matrix<string>; /** Returns a cloned copy of the provided matrix */ export declare function cloneMatrix<T>(matrix: T[][]): T[][]; /** * Returns true if the contents of the two 2d matrices are equal when the * cells are compared with === */ export declare function matricesAreEqual<T>(m1: T[][], m2: T[][]): boolean; export declare function makeMatrix<T = number>(width: number, height: number, initialValue: T): Matrix<T>; export declare function makeObjectMatrix<T>(width: number, height: number): Array<Array<T>>; export declare function makeEmptyMatrix<T>(width: number, height: number): Array<Array<T | undefined>>;