COSC-3P91-Assignments/Assignment 2/src/ca/cosc3p91/a2/util/Util.java

16 lines
310 B
Java
Raw Normal View History

2023-04-04 15:58:32 -04:00
package ca.cosc3p91.a4.util;
2023-03-03 16:08:23 -05:00
import java.util.Random;
public class Util {
public static int randomInt(int min, int max, Random random) {
return random.nextInt(max - min) + min;
}
public static int clamp(int min, int max, int i){
return Math.min(Math.max(i, min), max);
}
}