diff --git a/frontend/static/challenges/sourcecode.txt b/frontend/static/challenges/sourcecode.txt index 5f68d45e1..02e1bff1d 100644 --- a/frontend/static/challenges/sourcecode.txt +++ b/frontend/static/challenges/sourcecode.txt @@ -22235,7 +22235,7 @@ class WordGenerator extends Wordset { this.ngrams[prefix] = new CharDistribution(); } this.ngrams[prefix].addChar(c); - prefix = (prefix + c).slice(-prefixSize); + prefix = (prefix + c).substr(-prefixSize); } } } @@ -22243,7 +22243,7 @@ class WordGenerator extends Wordset { randomWord() { let word = ""; for (;;) { - const prefix = word.slice(-prefixSize); + const prefix = word.substr(-prefixSize); let charDistribution = this.ngrams[prefix]; if (!charDistribution) { // This shouldn't happen if this.ngrams is complete. If it does