package chanceapps; import chance.Die; public class Roller { public static void main(String[] args) { candrstandard5times(); candrtwentysided5times(); candrstandard(20); candrstandard(30); candrninesided(20); candrninesided(30); System.out.println("Ten rolls of a standard die for a 1"); for (int i = 1; i <= 10; i++) { candrstandarddiefor1(); System.out.println(""); } System.out.println("Ten rolls of a twelve sided die for a 1"); for(int i = 1; i <=10; i++){ candrtwelvesidedfor1(); System.out.println(""); } } private static void candrtwelvesidedfor1() { Die DIO = new Die(12); while (DIO.top()!=1){ DIO.roll(); System.out.print(DIO.top()+" "); } } private static void candrstandarddiefor1() { Die DIO = new Die(); while (DIO.top()!=1){ DIO.roll(); System.out.print(DIO.top()+" "); } } private static void candrninesided(int i) { System.out.println("Roll a nine sided die " +i +" times: "); Die dieun = new Die(9); int u = 0; while(u < i) { dieun.roll(); System.out.print(dieun.top() + " "); u++; } System.out.println(""); } private static void candrstandard(int i) { System.out.println("Roll a standard die " +i +" times: "); Die dieun = new Die(); int u = 0; while(u < i) { dieun.roll(); System.out.print(dieun.top() + " "); u++; } System.out.println(""); } private static void candrtwentysided5times() { System.out.println("Roll a twenty sided die 5 times: "); Die dieun = new Die(20); for(int u = 0;u < 5;u++) { dieun.roll(); System.out.print(dieun.top() + " "); } System.out.println(""); } private static void candrstandard5times(){ System.out.println("Roll a standard die 5 times: "); Die dieun = new Die(); for(int u = 0;u < 5;u++) { dieun.roll(); System.out.print(dieun.top() + " "); } System.out.println(""); } }