SAE21_2022/RandomDirection.java

15 lines
365 B
Java
Raw Normal View History

2023-04-11 23:41:40 +02:00
import java.util.Random;
public class RandomDirection {
public static final int UP = 0;
public static final int DOWN = 1;
public static final int LEFT = 2;
public static final int RIGHT = 3;
public static int getRandomDirection() {
Random rand = new Random();
int direction = rand.nextInt(4);
return direction;
}
}