private static Random rng = new Random();
private static bool AskRollAgain()
Console.WriteLine("Do you want to roll again?");
return Console.ReadLine().ToLower() == "y";
public static void Main()
int dice1 = rng.Next() % 6;
int dice2 = rng.Next() % 6;
int dice3 = rng.Next() % 6;
Console.WriteLine(string.Format("You got: {0}-{1}-{2}", dice1, dice2, dice3));
rollAgain = AskRollAgain();