Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Triacontakai
- * This program generates a certain amount of numbers between a specified range, both specified by the user
- * Input: Range and Amount
- * Output: Random Number between 1-range, generated "amount" times
- */
- import java.util.*;
- public class DiceRoll {
- public static void main(String[]args) {
- Scanner scan = new Scanner(System.in);
- Random rnum = new Random();
- int counter;
- System.out.println("Enter range (1-n): ");
- int range = scan.nextInt();
- System.out.println("Enter amount of dice rolls: ");
- int count = scan.nextInt();
- for (counter = 1; counter <= count; counter++) {
- int x = rnum.nextInt(range)+1;
- System.out.println(x);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement