
import java.util.*;

public class DiceRoll {
	
	public static void main(String[] args) {

		Random r = new Random();
		
		
		int numTimes = 0;
		int numTwosRolled = 0;
		
		while (numTimes < 20) {
		
			int die1 = r.nextInt(6) + 1;
			int die2 = r.nextInt(6) + 1;
			System.out.println("You rolled "+die1+" and "+die2);
						
			if (die1+die2 == 2) {
				numTwosRolled++;
			}
				
			
			// Shorthand for numTimes = numTimes + 1;
			numTimes++; 
		
		}
		
		System.out.println("Probability of getting 2 is "+((double)numTwosRolled/numTimes));
		System.out.println("We got snakeeyes "+numTwosRolled+" times.");
		System.out.println("Real prob is "+(1.0/36));
				
	}
}