Guest User

Untitled

a guest
Jul 16th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. Jumble = {
  2. /* Letter distribution according to Scrabble */
  3. 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'],
  4.  
  5. /* Value of each letter according to Scrabble */
  6. 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},
  7.  
  8. /* List of words */
  9. dictionary: ''
  10.  
  11. isWordValid: function(word) {
  12. if(dictionary.indexOf(word) != -1) {
  13. return false;
  14. } else {
  15. return true;
  16. }
  17. }
  18. }
  19.  
  20.  
  21.  
  22. /* Event handlers */
  23. $(document).ready(function() {
  24. /* Read database */
  25. $.get('./words.txt', function(database) {
  26. Jumble.dictionary = database.split('\n');
  27. } );
  28. } );
Add Comment
Please, Sign In to add comment