0) this.fallingLetters.slice().each( function (ea) { this.letterFallToPile(ea); }.bind(this)); // unused letter falls to pile if (this.activeLetters.length == 0) return; var letter = this.activeLetters[0]; // Will be on the belt letter.moveBy(pt(this.xStep, 0)); // Drop letter from belt to rack, and then drop anew one onto belt if (letter.bounds().topRight().x < this.rack.bounds().topRight().x) this.letterDropOntoRack(letter); // Propagate leftward motion along rack when letters touch this.lettersSlideOnRack(); // If leftmost letter is off rack then drop it if (this.activeLetters.last().bounds().center().x < this.rack.bounds().topLeft().x) this.letterFallOffEnd(); }]]> 0) this.fillLetter(this.multBoxes[nLetters-1], Color.blue); this.letterScoreBox.setTextString(this.letterScore.toString()); this.wordScore = this.letterScore*this.multipliers[nLetters]; this.wordScoreBox.setTextString(this.wordScore.toString()); }]]> 0 && consonants.length > 0) { // Assemble letters according to their overall ratio if ( (vowels.length / (vowels.length + consonants.length)) > ratio) mixed.push(vowels.pop()); else mixed.push(consonants.pop()); } // pick up any leftovers return mixed.concat(consonants, vowels) }]]> 0) this.removeFromOutbox(this.outboxLetters.pop()); this.updateOutbox(); }]]> this.bestWordScore) { this.bestWordScore = this.wordScore; this.bestWordBox.setTextString(this.bestWordScore.toString()); this.bestWord = word; this.bestWordLetters.setTextString(this.bestWord); } this.outboxLetters = []; this.updateOutbox(); }]]>0) ? this.addMorphBack(this.letterSource.shift()) : null; this.nLeftBox.setRichText(new lively.Text.Text(this.letterSource.length.toString(), {align: 'center'})); } }]]> 300) { this.fallingLetters.shift(); this.nMissed ++; this.pointsMissed += this.letterValue(letter.textString); this.missedPointsBox.setRichText(new lively.Text.Text((-this.pointsMissed).toString(), {align: 'center'})); this.totalScore -= this.letterValue(letter.textString); this.totalScoreBox.setTextString(this.totalScore.toString()); } }]]> 0 && consonants.length > 0) { // Assemble letters according to their overall ratio if ( (vowels.length / (vowels.length + consonants.length)) > ratio) mixed.push(vowels.pop()); else mixed.push(consonants.pop()); } // pick up any leftovers return mixed.concat(consonants, vowels); }, letterValue: function (char) { var letterValues = { E: 1, N: 1, S: 1, I: 1, R: 1, T: 1, U: 1, A: 1, D: 1, H: 2, G: 2, L: 2, O: 2, M: 3, B: 3, W: 3, Z: 3, C: 4, F: 4, K: 4, P: 4, Ä: 6, J: 6, Ü: 6, V: 6, Ö: 8, X: 8, Q: 10, Y: 10, ß: 10}; return letterValues[char] || 1; }, doLoadWordList: function (val) { if (!val) { this.wordList = null; return }; if (this.cachedWordLists) { this.wordList = this.cachedWordLists['german']; return; } res = new WebResource('http://lively-kernel.org/repository/webwerkstatt/marko/res/combinedWords_de.json'); this.wordList = JSON.unserialize(res.get().content); }, }); */]]>