Processing Forum
But this doesn't ensure that each string in words [ ] is used once and only once (ie: some strings are used more than once while some aren't represented at all). I am looking for a way to randomize my array based on different seeds, while ensuring that each new permutation includes all the elements from the original array and only uses them once.String[] words = {"apple", "bear", "cat", "dog", "yak", "pear", "bat", "antelop"};int index = words.length;
randomSeed(2);for (int i=0; i < index; i++) {int r = (int) random (index);println (words[r]);}