gamekit-utils
Version:
Minimal, fast and useful utilities for randomness, array manipulation and math — built for games, UI logic and generative design.
9 lines (8 loc) • 342 B
TypeScript
/**
* Creates a 2D array.
* @param rows The number of rows.
* @param cols The number of columns.
* @param value The initial value or a function to generate values.
* @returns A 2D array filled with the specified value.
*/
export declare function create2D<T>(rows: number, cols: number, value: T | ((r: number, c: number) => T)): T[][];