Skip to content

arhpreston/scrambler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Solve scramble (the game)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published