I needed to obtain a JSON object containing the tile values on scrabble tiles for a project I took on. This was across 8 dictionaries (6 languages). The problem was, I couldn’t find a good source for the required data. I have since found a far easier way to obtain the data but it was still a fun challenge.
The best I could do at the time was http://en.wikipedia.org/wiki/Scrabble_letter_distributions.
The data was laid out as displayed below and it didn’t look very friendly.
In other words
- For each of the six languages specified, find the span with an id equal to the language.
- Find the first list following the parent of the identified span
- For each bold letter in the list, assign the integer value of the italicized text which is a sibling of that letter to that letters index in that languages array.
- Example, for the English dictionary, Q and Z (bold) are 10 points (italicized). The integer value of “10 points” is of course 10.