// random_dice1: rolling a die and using "if" to ascertain the result in your game! public class random_dice1 { public static void main(String[] args) { int roll; roll = 1 + (int) (Math.random() * 6); if (roll == 1 ) System.out.println("You rolled a one! Try again! \n"); else if (roll == 2 ) System.out.println("You rolled a two! Too bad! \n"); else if (roll == 3 ) System.out.println("You rolled a three! Better luck next time! \n"); else if (roll == 4 ) System.out.println("You rolled a four! Sorry! \n"); else if (roll == 5 ) System.out.println("You rolled a five! Way to go!!\n"); else if (roll == 6 ) System.out.println("You rolled a six! I guess you win ...\n"); else System.out.println("This is some wierd die! \n"); System.exit (0); } }