Skip to content

Commit 30477d3

Browse files
committed
Add Utils
1 parent 0ffdb8f commit 30477d3

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package hexlet.code.games;
2+
3+
public class Utils {
4+
5+
public static int randomIntValue(int leftBorder, int rightBorder) {
6+
return (int) (Math.random() * (rightBorder - leftBorder)) + leftBorder;
7+
}
8+
9+
public static int randomIntValue() {
10+
final int left = 1;
11+
final int right = 26;
12+
return randomIntValue(left, right);
13+
}
14+
}

0 commit comments

Comments
 (0)