Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Random;
- public class DiceRolls {
- public static int howBig = 20;
- public static int[] rolls;
- public static int[] fillRolls(int size, int howMany) {
- int[] destArray = new int[howMany];
- for (int i=0; i<howMany; i++) {
- Random dice = new Random();
- destArray[i] = dice.nextInt(size)+1;
- }
- return destArray;
- }
- public static void main(String[] Args) {
- rolls = fillRolls(6, 5);
- for (int i=0; i<5; i++) {
- System.out.println(rolls[i]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement