Advertisement
Guest User

yeet

a guest
Apr 23rd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.48 KB | None | 0 0
  1. using System;
  2.  
  3. namespace RollDice
  4. {
  5.     class Program
  6.     {
  7.         static Random rand = new Random();
  8.         static int diceRoll = 0;
  9.  
  10.         static void Main(string[] args)
  11.         {
  12.             for (int i = 0; i < 10; i++)
  13.             {
  14.                 diceRoll = rand.Next(1, 7);
  15.                 switch (diceRoll)
  16.                 {
  17.                     case 1:
  18.                         Console.WriteLine(diceRoll.ToString());
  19.                         break;
  20.                    
  21.                     case 2:
  22.                         Console.WriteLine(diceRoll.ToString());
  23.                         break;
  24.  
  25.                     case 3:
  26.                         Console.WriteLine(diceRoll.ToString());
  27.                         break;
  28.                    
  29.                     case 4:
  30.                         Console.WriteLine(diceRoll.ToString());
  31.                         break;
  32.                    
  33.                     case 5:
  34.                         Console.WriteLine(diceRoll.ToString());
  35.                         break;
  36.  
  37.                     case 6:
  38.                         Console.WriteLine(diceRoll.ToString());
  39.                         break;
  40.  
  41.                     default:
  42.                         Console.WriteLine("Something went wrong :(");
  43.                         break;
  44.                 }
  45.  
  46.                 Console.WriteLine("You have rolled a: " + diceRoll.ToString());
  47.                 Console.WriteLine("Total: " + i.ToString());
  48.             }
  49.         }
  50.     }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement