词汇量不够,还蠢,于是就写了个JavaScript来解WordScramble了. .
需要jQuery才能运行. .
1 2 3 4 5 6 7 8 9 10 11 12 | var wordList = $.getJSON('https://raw.githubusercontent.com/words/an-array-of-english-words/master/words.json'); var letters = 'yotbanl'; // 提供的字母 wordList.responseJSON.filter(function(word) { return word.length == letters.length; }).filter(function(word) { for (var c of letters) { if (!word.includes(c)) { return false; } } return true; }); |
[“notably”]
于是从提供的字母yotbanl里找到了对应的unscrambled单词notably. .
早上好