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

Method shuffle

core/src/processing/data/DoubleList.java:744–754  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

742 * @brief Randomize the order of the list elements
743 */
744 public void shuffle() {
745 Random r = new Random();
746 int num = count;
747 while (num > 1) {
748 int value = r.nextInt(num);
749 num--;
750 double temp = data[num];
751 data[num] = data[value];
752 data[value] = temp;
753 }
754 }
755
756
757 /**

Callers

nothing calls this directly

Calls 1

randomMethod · 0.80

Tested by

no test coverage detected