Skip to content

Instantly share code, notes, and snippets.

@theorigin
Created May 29, 2021 10:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theorigin/46d560f3c4e8bb378cc2325134d21ce5 to your computer and use it in GitHub Desktop.
Save theorigin/46d560f3c4e8bb378cc2325134d21ce5 to your computer and use it in GitHub Desktop.
Roll the dice
void Main()
{
var numberOfDice = 2;
var numberOfRolls = 2;
Console.WriteLine("Roll the Dice");
Console.WriteLine("=============");
Console.WriteLine("How many dice do you want to roll?");
Console.WriteLine("How many times do you want to roll?");
for (int r = 1; r <= numberOfRolls; r++)
{
Console.WriteLine($"Roll {r}");
for (int d = 1; d <= numberOfDice; d++)
{
Console.WriteLine($"Dice {d}");
}
Console.WriteLine($"Total for roll {r} was ");
}
Console.WriteLine("Total for all rolls was ");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment