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

Method shuffle

core/src/processing/data/StringList.java:575–585  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

573 * @brief Randomize the order of the list elements
574 */
575 public void shuffle() {
576 Random r = new Random();
577 int num = count;
578 while (num > 1) {
579 int value = r.nextInt(num);
580 num--;
581 String temp = data[num];
582 data[num] = data[value];
583 data[value] = temp;
584 }
585 }
586
587
588 /**

Callers

nothing calls this directly

Calls 1

randomMethod · 0.80

Tested by

no test coverage detected