public static void Main()
int score = GetScore(dice);
Console.WriteLine("Dice: {0}", string.Join(",", dice.Select(x => x.ToString())));
Console.WriteLine("Score: {0}", score);
static Random _rnd = new Random();
public static int[] RollDice()
return new int[] { _rnd.Next(0, 7), _rnd.Next(0, 7), _rnd.Next(0, 7),
_rnd.Next(0, 7), _rnd.Next(0, 7), _rnd.Next(0, 7) };
public static int GetScore(int[] dice)
var grouped = dice.GroupBy(x => x);
score += grouped.Count(x => x.Count() == 3) * 3;
score += grouped.Count(x => x.Count() == 4) * 6;
score += grouped.Count(x => x.Count() == 5) * 12;