using System;
using System.Collections.Generic;
using System.Text;
namespace _303_fall_2007_lecture_17
{
class Program
{
static void Main(string[] args)
{
//int[] myArray = new int[50];
//// fills in the array - each cell has the value 42
//for (int i = 0; i < 50; i++)
//{
// myArray[i] = i * 2;
//}
//// display all the cells to the screen
//for (int i = 0; i < 50; i++)
//{
// Console.Write(myArray[i] + " ");
//}
int[] d = new int[6];
Random r = new Random();
// roll the die 6000 times
for (int i = 0; i < 6000; i++)
{
// roll the die
int roll = r.Next(1, 7);
Console.Write(roll + " ");
// increment the slot in the array that counts the roll'th event
// subtract 1 because the array indices go from 0-5 (not 1-6)
d[roll - 1]++;
}
for (int i = 0; i < 6; i++)
{
Console.WriteLine("I rolled a {0} {1} times", i + 1, d[i]);
}
}
}
}