Last active
July 5, 2017 14:20
-
-
Save JokerMartini/1a6971f08edabb7e1014 to your computer and use it in GitHub Desktop.
Maxscript: Shuffles the array returning an array of shuffled indices based on the supplied count.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn ShuffleIndexes count = | |
( | |
list = #() | |
list.count = count | |
for k = 1 to count do | |
( | |
i = random 1 k | |
list[k] = list[i] | |
list[i] = k | |
) | |
list | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment