title: checking that a number is within range
body: <p>am trying to make a mastermind game using an array of ints where I having the user guess a number sequence between 4-10 instead of colours. My GetAValidNumber is suppose to displays a prompt to the user and
  get a number from the user in the minimum/maximum range as specified in
  the parameters. If the number entered is outside the minimum/maximum
  range, then an error message is suppose to be displayed and
  the user is re-prompted for the number but for some reason it isn't validating properly.</p>
  
  <p>Any Guidance would be appreciated</p>
  
  <pre><code>    public static int GetAValidNumber(string inputMessage)
      {
          // declare variables
          int validInteger;
          bool inputIsValid = false;
          int lowValue = 1;
          int highValue = 10;
          while (!int.TryParse(Console.ReadLine(), out validInteger))
          {
              Console.WriteLine("Invalid entery - try again.");
              Console.Write(inputMessage, lowValue, highValue);
              do
              {
                  while (!int.TryParse(Console.ReadLine(), out validInteger))
                  {
                      Console.WriteLine("Invalid entery - try again.");
                      Console.Write(inputMessage);
                  }
                  if (validInteger &lt; lowValue || validInteger &gt; highValue)
                  {
                      Console.WriteLine("Your number is out of Range: ");
                  }
                  else
                  {
                      inputIsValid = true;
                  }
  
              } while (validInteger &lt; lowValue || validInteger &gt; highValue);
          }
          return validInteger;
      }
  
      // This method directs the play of the game
      public static void PlayGame()
      {
          int userNumbers;
          int userGuess;
          int difficulty;
          int randomNumbers;
  
          Console.WriteLine("How Many Numbers Would You Like To Use When Playing(4-10): ");
          userNumbers = GetAValidNumber(Console.ReadLine());
  
          Console.WriteLine("Choose a difficulty level (1 -3");
          difficulty = GetAValidNumber(Console.ReadLine());
          Console.WriteLine("A 5-digit number has been chosen. Each possible digit may be the number 1, 2, 3, or 4");
          Console.ReadLine();
          Console.WriteLine("Enter Your Guess {0} guesses remaning", GetGameDifficulty(difficulty, randomNumbers = GetRandomNumberCount(difficulty)));
          userGuess = GetAValidNumber(Console.ReadLine());
          Console.WriteLine("Your Guess was {0}, Your Results are {1}", userGuess, CountHits(userGuess, randomNumbers));
          Console.ReadLine();
  
      }
  </code></pre>