scrabble-solver
Version:
Scrabble Solver 2 - Free, open-source, cross-platform, multi-language analysis tool for Scrabble, Scrabble Duel, Super Scrabble, Letter League, Literaki, and Kelimelik. Quickly find the top-scoring words using the given board and tiles.
10 lines (8 loc) • 318 B
text/typescript
import { createArray } from './createArray';
export const createGridOf = <T>(width: number, height: number, getInitialValue: (x: number, y: number) => T): T[][] => {
return createArray(height).map((_row, y) => {
return createArray(width).map((_cell, x) => {
return getInitialValue(x, y);
});
});
};