MCPcopy Create free account
hub / github.com/benfry/processing4 / choice

Method choice

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

Return a random value from the list.

()

Source from the content-addressed store, hash-verified

678 * Return a random value from the list.
679 */
680 public int choice() {
681 if (count == 0) {
682 throw new ArrayIndexOutOfBoundsException("No entries in this IntList");
683 }
684 return data[(int) (Math.random() * count)];
685 }
686
687
688 // see notes in StringList

Callers

nothing calls this directly

Calls 1

randomMethod · 0.45

Tested by

no test coverage detected