Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Jumble = {
- /* Letter distribution according to Scrabble */
- letters: ['a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'b', 'b', 'c', 'c', 'd', 'd', 'd', 'd', 'e', 'e', 'e', 'e', 'e', 'e', 'e', 'e', 'e', 'e', 'e', 'e', 'f', 'f', 'g', 'g', 'g', 'h', 'h', 'i', 'i', 'i', 'i', 'i', 'i', 'i', 'i', 'i', 'j', 'k', 'l', 'l', 'l', 'l', 'm', 'm', 'n', 'n', 'n', 'n', 'n', 'n', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'p', 'p', 'q', 'r', 'r', 'r', 'r', 'r', 'r', 's', 's', 's', 's', 't', 't', 't', 't', 't', 't', 'u', 'u', 'u', 'u', 'v', 'v', 'w', 'w', 'x', 'y', 'y', 'z'],
- /* Value of each letter according to Scrabble */
- letterValues: {'a':1, 'b':3, 'c':3, 'd':2, 'e':1, 'f':4, 'g':2, 'h':4, 'i':1, 'j':8, 'k':5, 'l':1, 'm':3, 'n':1, 'o':1, 'p':3, 'q':10, 'r':1, 's':1, 't':1, 'u':1, 'v':4, 'w':4, 'x':8, 'y':4, 'z':10},
- /* List of words */
- dictionary: ''
- isWordValid: function(word) {
- if(dictionary.indexOf(word) != -1) {
- return false;
- } else {
- return true;
- }
- }
- }
- /* Event handlers */
- $(document).ready(function() {
- /* Read database */
- $.get('./words.txt', function(database) {
- Jumble.dictionary = database.split('\n');
- } );
- } );
Add Comment
Please, Sign In to add comment