How I spent Saturday night

My wife keeps winning when we play scrabulous. So I wrote some performance-enhancing javascript here to close the gap.

The first time the page loads, you have to download the whole 1.4 mb word dictionary. Then your browser will cache that file locally, so future look-ups are really quick.

There’s at least one bug so far. When you submit your list of tiles like ABCDEFG and your pattern B..Y.. I make a regular expression object where I replace each dot with [ABCDEFG]. So that means I’m not keeping track of how many of each tile you have. If the BGGYGG were a real word, then my function would suggest it, even though this is clearly impossible.

Along with fixing that bug, I want to make a few improvements:

  • Figure out how to make this into a firefox extension.
  • Display the score next to each word suggestion.