Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace RollDice
- {
- class Program
- {
- static Random rand = new Random();
- static int diceRoll = 0;
- static void Main(string[] args)
- {
- for (int i = 0; i < 10; i++)
- {
- diceRoll = rand.Next(1, 7);
- switch (diceRoll)
- {
- case 1:
- Console.WriteLine(diceRoll.ToString());
- break;
- case 2:
- Console.WriteLine(diceRoll.ToString());
- break;
- case 3:
- Console.WriteLine(diceRoll.ToString());
- break;
- case 4:
- Console.WriteLine(diceRoll.ToString());
- break;
- case 5:
- Console.WriteLine(diceRoll.ToString());
- break;
- case 6:
- Console.WriteLine(diceRoll.ToString());
- break;
- default:
- Console.WriteLine("Something went wrong :(");
- break;
- }
- Console.WriteLine("You have rolled a: " + diceRoll.ToString());
- Console.WriteLine("Total: " + i.ToString());
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement