File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -4830,6 +4830,26 @@ public final void randomSeed(long seed) {
48304830 }
48314831
48324832
4833+ /**
4834+ * Return a random integer from 0 up to (but not including)
4835+ * the specified value for “high”. This is the same as calling random()
4836+ * and casting the result to an <b>int</b>.
4837+ */
4838+ public final int choice(int high) {
4839+ return (int) random(high);
4840+ }
4841+
4842+
4843+ /**
4844+ * Return a random integer from “low” up to (but not including)
4845+ * the specified value for “high”. This is the same as calling random()
4846+ * and casting the result to an <b>int</b>.
4847+ */
4848+ public final int choice(int low, int high) {
4849+ return (int) random(low, high);
4850+ }
4851+
4852+
48334853
48344854 //////////////////////////////////////////////////////////////
48354855
Original file line number Diff line number Diff line change @@ -15,14 +15,14 @@ X https://github.com/processing/processing4/issues/544
1515data
1616X use choice() instead of random() for list classes
1717X remove random(PApplet) since unlikely to be used/seems overkill
18- _ add choice() as a PApplet method for int values of random()?
18+ X add choice() as a PApplet method for int values of random()
19+
1920
2021contrib
2122_ Loading SVG file gives Illegal base64 character 20 encoding error (worked in v3.5.4)
2223_ https://github.com/processing/processing4/issues/592
2324_ https://github.com/processing/processing4/issues/592
2425
25-
2626_ freeze on resize with Windows (even the default renderer)
2727_ https://github.com/processing/processing4/issues/507
2828
You can’t perform that action at this time.
0 commit comments