Solve scramble (the game)
Python JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
static
.gitignore
README.md
scrambler.js
scrambler.py

README.md

Scrambler

Calculate all possible words (and their score) for a given game of scramble.

The scramble board is a graph. The program works by generating all possible paths through the graph while ensuring no node is visited more than once, and that every path retains the potential to be a word.

Words are taken from the official scrabble dictionary. On startup they are stored in a trie for fast (O(1)) lookup.

Usage

To simulate the following game

UNPG,RIAE,EAYS,TSTO

Go to http://preston.co.nz/scrambler.html or run

$ python scrambler.py UNPG,RIAE,EAYS,TSTO -tl 8 -tw 9 -tl 10 -tl 14

After a few seconds an ordered (by score) list of all possible words will be printed:

64 64 PIRAYAS       [2, 5, 4, 9, 10, 6, 11]
124 60 YAREST       [10, 9, 4, 8, 13, 14]
...
5800 2 SO           [11, 15]
Total words: 312
Sum (top 20): 985
Sum (top 50): 2103

For help on the command line

$ python scrambler.py --help

Notes

Scramble is available on android and ios.