Skip to content

This is a Fisher–Yates shuffle used for shuffling string arrays; the algorithm used here is as described: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#Modern_method The great part about this shuffle, is that it doesn't require another array. The code simply swaps pairs of numbers in the array in such a way that results in a randomi…

justintopiary/Shuffling-Arrays-of-String-Type-in-Processing-Fisher-Yates-shuffle-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Shuffling Array of String Type in Processing (Fisher Yates shuffle)

This is a Fisher–Yates shuffle used for shuffling string arrays; the algorithm used here is as described: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#Modern_method
The great part about this shuffle, is that it doesn't require another array to be substituted into. The code simply swaps pairs of numbers in the array in such a way that results in a randomised array. The code creates an unbiased permutation, and thus every permutation should be equally as likely. I hope this helped! This was coded in Processing 3.5.3

Lots of love, JustinTopiary

About

This is a Fisher–Yates shuffle used for shuffling string arrays; the algorithm used here is as described: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#Modern_method The great part about this shuffle, is that it doesn't require another array. The code simply swaps pairs of numbers in the array in such a way that results in a randomi…

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published