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

Method shuffle

core/src/processing/data/IntList.java:699–709  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

697 * @brief Randomize the order of the list elements
698 */
699 public void shuffle() {
700 Random r = new Random();
701 int num = count;
702 while (num > 1) {
703 int value = r.nextInt(num);
704 num--;
705 int temp = data[num];
706 data[num] = data[value];
707 data[value] = temp;
708 }
709 }
710
711
712 /**

Callers

nothing calls this directly

Calls 1

randomMethod · 0.80

Tested by

no test coverage detected