Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- import java.util.Random;
- public class ConfigTestArea
- {
- public static void main(String[] args)
- {
- ConfigTestArea Obj = new ConfigTestArea();
- Obj.go();
- }
- public void go()
- {
- Scanner scan = new Scanner(System.in);
- Random rand = new Random();
- int diceIntA =1;
- int diceIntB =1;
- int diceMinA = 1;
- int diceMinB =1;
- int count = 0;
- System.out.println("How many sides does the first dice have?");
- diceIntA = scan.nextInt();
- System.out.println("How many sides does the second dice have?");
- diceIntB = scan.nextInt();
- scan.close();
- switch(count)
- {
- case 0:
- int diceRandomA = rand.nextInt((diceIntA - diceMinA) +1) + diceMinA;
- int diceRandomB = rand.nextInt((diceIntB - diceMinB) +1) + diceMinB;
- System.out.println("Dice 1 first roll is " + (diceRandomA));
- System.out.println("Dice 2 first roll is " + (diceRandomB));
- count++;
- case 1:
- int diceRandomA1 = rand.nextInt((diceIntA - diceMinA) +1) + diceMinA;
- int diceRandomB1 = rand.nextInt((diceIntB - diceMinB) +1) + diceMinB;
- System.out.println("Dice 1 second roll is " + (diceRandomA1));
- System.out.println("Dice 2 second roll is " + (diceRandomB1));
- count++;
- case 2:
- int diceRandomA2 = rand.nextInt((diceIntA - diceMinA) +1) + diceMinA;
- int diceRandomB2 = rand.nextInt((diceIntB - diceMinB) +1) + diceMinB;
- System.out.println("Dice 1 third roll is " + (diceRandomA2));
- System.out.println("Dice 2 third roll is " + (diceRandomB2));
- count++;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement