title: Repeating program in C#
body: <p>I have created a dice simulator program in C# but in the assignment requirements it says it needs to be able to repeat as many times as the user wants.</p>
  
  <p>It's simple in python:</p>
  
  <pre><code>def var():
  
      import random
  
      dicesides = int(input("Please enter the amount of sides you want the dice that is being thrown to have. The dice sides available are: 4, 6 and 12: "))
      script(dicesides, random)
  
  def script(dicesides, random):  
      if dicesides in (4,6,12):
          dice = int(random.randrange(1, dicesides))
          print(dicesides, " sided dice, score", dice)
      else:
          print("That number is invalid. Please try again.")
          var()
  
      repeat = str(input("Repeat? Simply put yes or no : "))
  
      if repeat == "yes":
          var()
      else:
          quit()            
  var()
  </code></pre>
  
  <p>And this is my c# code:</p>
  
  <pre><code>static void Main(string[] args)
          {
              Random random = new Random();
  
              int num;
              Console.WriteLine("Please enter the amount of sides you want the dice that is being thrown to have. The dice sides available are: 4, 6 and 12: ");
              num = Convert.ToInt32(Console.ReadLine());
  
              if (num == 4 || num == 6 || num == 12)
              {
                  int randomDice = random.Next(0, num);
                  Console.WriteLine(num + " sided dice thrown, " + randomDice);
              }
              else
              {
                  Console.WriteLine("That number is invalid. Please try again.")
              }
  
  
          }
  </code></pre>
  
  <p>How would I get the program to repeat?</p>