MCPcopy Index your code
hub / github.com/processing/processing / shuffle

Method shuffle

core/src/processing/data/FloatList.java:752–762  ·  view source on GitHub ↗

Randomize the order of the list elements. Note that this does not obey the randomSeed() function in PApplet. @webref floatlist:method @brief Randomize the order of the list elements

()

Source from the content-addressed store, hash-verified

750 * @brief Randomize the order of the list elements
751 */
752 public void shuffle() {
753 Random r = new Random();
754 int num = count;
755 while (num > 1) {
756 int value = r.nextInt(num);
757 num--;
758 float temp = data[num];
759 data[num] = data[value];
760 data[value] = temp;
761 }
762 }
763
764
765 /**

Callers

nothing calls this directly

Calls 1

randomMethod · 0.80

Tested by

no test coverage detected