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 (13 loc) 625 B
import { Board, Cell, Pattern, Tile } from '@scrabble-solver/types'; import { getPatternHash } from './getPatternHash'; describe('getPatternHash', () => { const board = Board.fromStringArray([' t ', 'do ', ' ']); it('hashes blanks', () => { const pattern = new Pattern(board, [ new Cell({ x: 0, y: 0, tile: new Tile({ character: 'a', isBlank: false }) }), new Cell({ x: 0, y: 1, tile: new Tile({ character: 'b', isBlank: true }) }), new Cell({ x: 0, y: 2, tile: new Tile({ character: 'c', isBlank: false }) }), ]); expect(getPatternHash(pattern)).toBe('0,0,a-0,1,b!-0,2,c'); }); });