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.
18 lines (13 loc) • 394 B
text/typescript
import { Cell } from '@scrabble-solver/types';
export const generateStartIndices = (cells: Cell[]): number[] => {
if (cells.length === 0) {
return [];
}
const startIndices: number[] = [0];
for (let startIndex = 1; startIndex < cells.length - 1; ++startIndex) {
if (!cells[startIndex - 1].hasTile()) {
startIndices.push(startIndex);
}
}
return startIndices;
};