From 03ed7c4a39c05dd779d552cc9506e525fb57c45e Mon Sep 17 00:00:00 2001 From: Miodec Date: Tue, 22 Aug 2023 22:24:47 +0200 Subject: [PATCH] revert: sourcecode text change This partially reverts commit 6be5578e8fa0a808f5238b8686167b02b31ac6ba. --- frontend/static/challenges/sourcecode.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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