Skip to content

Commit

Permalink
fix: remove bogoSort
Browse files Browse the repository at this point in the history
Previous change did not actually prevent bogoSort from occuring as pointed out by @456dev. This should fix that.
  • Loading branch information
mavi0 committed Nov 28, 2024
1 parent e8aed63 commit 539b09b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web/priv/js_effects/sorting.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 539b09b

Please sign in to comment.