let scoreOf;
let bag;
let boardLangSelect;
- let dictionnary;
+ let dictionary;
const playerLetters = [];
let currentPlayer = "";
}
}
- function downloadDictionnary(code) {
- if (typeof downloadDictionnary.code === "undefined") {
- downloadDictionnary.code = "";
- } else if (downloadDictionnary.code === code) {
+ function downloadDictionary(code) {
+ if (typeof downloadDictionary.code === "undefined") {
+ downloadDictionary.code = "";
+ } else if (downloadDictionary.code === code) {
return;
}
- downloadDictionnary.code = code;
+ downloadDictionary.code = code;
const file = new XMLHttpRequest();
file.overrideMimeType("application/json");
file.onreadystatechange = function () {
if ((file.readyState === 4) && (file.status == "200")) {
try {
- dictionnary = JSON.parse(file.responseText);
+ dictionary = JSON.parse(file.responseText);
document.getElementById("check-spelling").disabled = false;
} catch (e) {
console.error(e);
localStorage.trivabbleBoardLang = value;
document.getElementById("board-lang").value = value;
document.getElementById("check-spelling").disabled = true;
- downloadDictionnary(value);
+ downloadDictionary(value);
break;
}
}
let words = searchNewWords();
- /* Check if words are in dictionnary */
+ /* Check if words are in dictionary */
let badWords = words.slice();
for (const k of Object.keys(badWords)) {
- if (dictionnary.includes(badWords[k])) {
+ if (dictionary.includes(badWords[k])) {
delete badWords[k];
}
}