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

Method shuffle

core/src/processing/data/LongList.java:700–710  ·  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

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

Callers

nothing calls this directly

Calls 1

randomMethod · 0.80

Tested by

no test coverage detected