From 539b09b5bddc7c8863f097bc62eea00cd65f80c6 Mon Sep 17 00:00:00 2001 From: Eleanor Davies Date: Thu, 28 Nov 2024 11:11:27 +0000 Subject: [PATCH] fix: remove bogoSort Previous change did not actually prevent bogoSort from occuring as pointed out by @456dev. This should fix that. --- web/priv/js_effects/sorting.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/priv/js_effects/sorting.js b/web/priv/js_effects/sorting.js index 7c395e9..7775b64 100644 --- a/web/priv/js_effects/sorting.js +++ b/web/priv/js_effects/sorting.js @@ -93,7 +93,8 @@ return class MyEffect { } selectRandomAlgorithm() { - return Math.random() < 0.01 ? 'bogoSort' : this.getRandomAlgorithm(); // set to 1 to get guaranteed bogoSort + return this.getRandomAlgorithm(); + // return Math.random() < 0.01 ? 'bogoSort' : this.getRandomAlgorithm(); // set to 1 to get guaranteed bogoSort } getRandomAlgorithm() {