-
-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
squint/core
Shuffle function suggestions
#513
Comments
Thanks! |
The source code you list after the squint link, is that a recommendation of how to do it, or not? |
kigiri
added a commit
to kigiri/squint
that referenced
this issue
Apr 30, 2024
kigiri
added a commit
to kigiri/squint
that referenced
this issue
Apr 30, 2024
kigiri
added a commit
to kigiri/squint
that referenced
this issue
Apr 30, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
squint/src/squint/core.js
Lines 1851 to 1855 in 6d6e3fc
This is not a good way to shuffle, distribution is biased, and it's not efficient.
Here an example of the distribution in chrome:
You can read more about why this isn't a recommanded method here:
https://stackoverflow.com/questions/962802/is-it-correct-to-use-javascript-array-sort-method-for-shuffling
And here, clicking on the solution for straitforward examples: https://javascript.info/task/shuffle
The text was updated successfully, but these errors were encountered: