File tree Expand file tree Collapse file tree 3 files changed +7
-2
lines changed
src/org/openpatch/scratch/extensions/math Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ index: 4
44lang : en
55---
66
7+ ## 4.15.2
8+
9+ - 🐛 Fix: Random.randomInt not return the maximum value.
10+
711## 4.15.1
812
913- 🐛 Fix: Edge detection not working correctly.
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ author.url=https://openpatch.org
4040# This is NOT a direct link to where to download it.
4141
4242library.url =https://github.com/openpatch/scratch-for-java
43- library.version =4.15.1
43+ library.version =4.15.2
4444
4545
4646# Set the category (or categories) of your Library from the following list:
Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ public static double random() {
132132 * @return a random integer
133133 */
134134 public static int randomInt (int max ) {
135- return getRandom ().nextInt (max );
135+ return getRandom ().nextInt (max + 1 );
136136 }
137137
138138 /**
@@ -153,6 +153,7 @@ public static double random(double max) {
153153 * @return a random integer
154154 */
155155 public static int randomInt (int min , int max ) {
156+ max += 1 ;
156157 return getRandom ().nextInt (max - min ) + min ;
157158 }
158159
You can’t perform that action at this time.
0 commit comments