UNPKG

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.

12 lines (9 loc) 302 B
import { RemainingTile } from 'types'; export const getRemainingTilesCount = (remainingTiles: RemainingTile[]): number => { return remainingTiles.reduce((sum, { count, usedCount }) => { if (typeof count === 'undefined') { return sum; } return sum + count - usedCount; }, 0); };