title: how to stop my code from looping at the end?
body: <p><strong>i'm new at coding C# pls help me fix this simple dice game, it keeps on looping at the end of the game</strong>
  ** apparently how i think is that in the end of this code something makes the NO commend on looping and getting re runed**</p>
  <pre><code>using System;
  
  namespace first_game
  {
      class Program
      {
          static void Main(string[] args)
          {
              string userName;
              userName = Console.ReadLine();
  
              #region
              {
                  int userPoint = 0;
                  int cpuPoint = 0;
                  int pDice;
                  bool closeApp;
                  while (true)
                  {
                      while (cpuPoint &lt; 10 &amp;&amp; userPoint &lt; 10)
                      {
                          Random rd = new Random();
                          pDice = rd.Next(1, 6);
                          #endregion
                          int P2Dice;
                          Random scondRd = new Random();
  
                          P2Dice = scondRd.Next(1, 6);
                          Console.ReadLine();
                          Console.WriteLine(&quot;-------------------&quot;);
                          Console.Write(&quot;playe dice:&quot;);
                          Console.WriteLine(pDice);
                          Console.Write(&quot;CPU dice:&quot;);
                          Console.WriteLine(P2Dice);
                          Console.ReadLine();
  
                          if (pDice &gt; P2Dice)
                          {
                              userPoint = userPoint + 1;
                          }
                          else if (pDice &lt; P2Dice)
                          {
                              cpuPoint = cpuPoint + 1;
                          }
                          Console.Clear();
                          Console.WriteLine(userName);
                          Console.Write(&quot;player point:&quot;);
                          Console.WriteLine(userPoint);
  
                          Console.Write(&quot;CPU point:&quot;);
                          Console.Write(cpuPoint);
                          Console.ReadLine();
                      }
                      if (userPoint == 10)
                      {
                          Console.WriteLine(&quot;-----------------\nYOU WIN!!!&quot;);
                          Console.ReadLine();
                      }
                      else
                      {
                          Console.WriteLine(&quot;-----------------\nYOU lost!!! LOL&quot;);
                          Console.ReadLine();
                      }
     
                      Console.WriteLine(&quot;wanna continue?\n press Y for yes   press N for NO&quot;);
                      ConsoleKeyInfo sw;
                      sw = Console.ReadKey();
                      Console.Clear();
                      if (sw.Key == ConsoleKey.Y)
                      {
                           userPoint = 0;
                           cpuPoint = 0;
                          continue;
                      }
  
                      else if (sw.Key == ConsoleKey.N)
                      {
                      
                      }
                      else
                          Console.WriteLine(&quot;ERROR!&quot;);
                  }  
  
              } 
                  
          }
          
      }
  }
  </code></pre>