Skip to content

Make random option more random#246

Open
jtwalters wants to merge 1 commit into
arielsalminen:masterfrom
jtwalters:fix-random
Open

Make random option more random#246
jtwalters wants to merge 1 commit into
arielsalminen:masterfrom
jtwalters:fix-random

Conversation

@jtwalters

Copy link
Copy Markdown
Contributor

The sort method doesn't do a good job of randomizing the order of the slides. With one iteration, elements only have a 50% chance of being swapped with their neighbor.

This code picks a child element at random and iterates until all slides have been appended to the parent container at random. I believe this is much more random than the current code you have.

@carloroosen

Copy link
Copy Markdown

In practice it means only the first 3 slides can be the first in the show.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants