Assume the possible outcome of a die thrown is one of {1,2,3,4,5,6}
When two dice are thrown three times, I want to collect random outcomes from two dice.
My implementation is
var q = from threeTimes in new int[] { 1, 2, 3 }
let set1 = new Random().Next(1, 6)
let set2 = new Random().Next(1, 6)
select new { s1 = set1, s2 = set2 };
foreach (var v in q)
{
Console.WriteLine("Die1 :{0} Die2 :{1}", v.s1, v.s2);
}
But most of the times I receive the same values for Die1 and Die2.
I mean
Die1: 5 Die2: 5
Die1: 2 Die2: 2
Die1: 2 Die2: 2
What correction do I need to make in order to get random pairs?