title: Dice Game made with c#
body: <p>So I'm making a dice game for my Assignment and I'm stuck because I don't know how to make 2 of the functions it wants me to include.  Those function are:</p>
  
  <p>For the game to allocate points to the player if out of the 5 dice he rolls 3,4 or 5 of a kind, but if the player rolls 2 of a kind he can re roll the 3 other dice 2 times(i.e. the dice which where not the 2 of a kind) so if the first time he rolls and doe not get 3,4 or 5 of a kind he re rolls for the 2nd time, but if he gets for example 3,4 or 5 of a kind on hist 1st re roll he does not get to re roll, and same for the 2nd re roll but if after the second roll he does not get 3,4 or 5 of a kind he gets 0 points.</p>
  
  <p>And that the game ends once the player or the AI/2nd player gets to a certain value i.e. their score gets to lets say 50.</p>
  
  <p>Here is the code I have so far:</p>
  
  <pre><code>class Game
      {
          public static void Main(string[] args)
  
          {
  
              Console.BackgroundColor = ConsoleColor.Red;
              Console.ForegroundColor = ConsoleColor.White;
              Console.WriteLine("Press enter to Start Game");
              Console.ReadKey();
              Console.ResetColor();
              Console.Clear();
  
  
              bool gameProg = false;
              while (gameProg == false)
              {
                  Console.WriteLine("Press Enter to roll your 5 Die");
                  Console.ReadKey();
                  Console.WriteLine();
                  Die.DieGen();
                  Console.ReadLine();
                  Console.Clear();
              }
  
             /* if(Score = 50)
              {
                  Console.WriteLine("\nCongratulation you have won press enter to exit");
                  Console.ReadKey();
              }*/
          }
  
      }
      class Die
      {
          public static void DieGen()
          {
              int i;
              int[] Score = new int[50];
              Random rnd = new Random();
              int die1 = rnd.Next(1, 6 + 1);
              int die2 = rnd.Next(1, 6 + 1);
              int die3 = rnd.Next(1, 6 + 1);
              int die4 = rnd.Next(1, 6 + 1);
              int die5 = rnd.Next(1, 6 + 1);
              Console.Write("You Rolled {0}", die1);
              Console.Write(" {0}", die2);
              Console.Write(" {0}", die3);
              Console.Write(" {0}", die4);
              Console.Write(" {0}", die5);
  
              int sum = die1 + die2 + die3 + die4 + die5;
  
              Console.WriteLine("Your Score {0}", sum);
  
              Score[sum]=Convert.ToInt32(Console.ReadLine());
  
              int tsum = Score.Sum();
              Console.WriteLine("Your Total Score {0}",tsum);
              Console.ReadLine();
  
  
          }
      }
      class Player
      {
          public static void Score()
          {
              int ScoreSum;
  
  
          }
      }
  </code></pre>
  
  <p>Currently, I was testing to see if I can get an array to store the numbers output for the sum of the dice and store them and add them and set a value to it so that once sum reaches 50 game ends and loop terminates, but it did not work (i.e. not what I'm supposed to do for assignment but wanted to see if I can use the score you get from rolling 3,4 or 5 of a kind to work with the array and sum it up and display it).</p>
  
  <p>Any help would be greatly appreciated.</p>