Rolling Dice with Auto-counting

  Download Source Code

/*** Rolling Dice ********************************
Betty used her dice-rolling program to investigate how often
matches occur when rolling 3 dice.  But it wasn't clear whether
matches or non-matches appear more often.  She wrote a program
to roll the dice 1000 times and automatically count the matches.
**************************************************/

Counting Loop

This program uses a loop to roll 3 dice 1000 times.  Each time, it automatically decides whether there was a MATCH
in the 3 dice or not.  If a MATCH occurs, it automatically adds 1 to MATCHES, which is a "running total" of the
number of times a match occurred.  At the end it divides by 1000 to give the fraction of times that a match occurred.
Since the result is below 0.5, it means that a person betting on this game should bet AGAINST a match, rather than
betting for a match.

Practice