UNPKG

scrabble-solver

Version:

Scrabble Solver 2 - Free, open-source, cross-platform, multi-language analysis tool for Scrabble, Scrabble Duel, Super Scrabble, Letter League, Crossplay, Literaki, and Kelimelik. Quickly find the top-scoring words using the given board and tiles.

13 lines (11 loc) 369 B
import { type Pattern } from '@scrabble-solver/types'; export const getPatternHash = (pattern: Pattern): string => { return pattern.cells .filter((cell) => cell.isEmpty) .map((cell) => { const blank = cell.tile.isBlank ? '!' : ''; const tile = cell.tile.character + blank; return [cell.x, cell.y, tile].join(','); }) .join('-'); };