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.

18 lines (17 loc) 617 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.areDigraphsValid = void 0; const areDigraphsValid = (config, pattern) => { const { twoCharacterTiles } = config; const { cells } = pattern; for (let index = 0; index < cells.length - 1; ++index) { const current = cells[index]; const next = cells[index + 1]; const digraphCandidate = current.tile.character + next.tile.character; if (twoCharacterTiles.includes(digraphCandidate)) { return false; } } return true; }; exports.areDigraphsValid = areDigraphsValid;