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 diceOneInt =1;
- int diceTwoInt =1;
- System.out.println("How many sides does the first dice have?");
- diceOneInt = scan.nextInt();
- System.out.println("How many sides does the second dice have?");
- diceTwoInt = scan.nextInt();
- scan.close();
- int diceOneRandomA = rand.nextInt(diceOneInt) +1;
- int diceTwoRandomA = rand.nextInt(diceTwoInt) +1;
- System.out.println("Dice 1 first roll is " + (diceOneRandomA));
- System.out.println("Dice 2 first roll is " + (diceTwoRandomA));
- int diceOneRandomB = rand.nextInt(diceOneInt) +1;
- int diceTwoRandomB = rand.nextInt(diceTwoInt) +1;
- System.out.println("Dice 1 first roll is " + (diceOneRandomB));
- System.out.println("Dice 2 first roll is " + (diceTwoRandomB));
- int diceOneRandomC = rand.nextInt(diceOneInt) +1;
- int diceTwoRandomC = rand.nextInt(diceTwoInt) +1;
- System.out.println("Dice 1 first roll is " + (diceOneRandomC));
- System.out.println("Dice 2 first roll is " + (diceTwoRandomC));
- System.out.println((diceOneRandomA + diceTwoRandomA + diceOneRandomB +
- diceTwoRandomB + diceOneRandomC + diceTwoRandomC) /6 );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement