title: How would i go about creating a win count and guess count for my random number guessing game C#
body: <p>Hey so i've got everything that i needed for my guessing game and everything checks out and runs without issue, the only problem is i want to have a wincount and a guess count so that the user can't get more guesses than what the program dictates. currently the program will tell you how many guesses you should be getting but it will only let you guess once because of the single if statement, so how would i go about doing this? </p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  
  namespace GuessingGame
  {
      class Program
      {
          static void Main(string[] args)
          {
              // Declare variables
              Int32 currentGuess, guessCount, winCount, upperLimit, randomNumber;
              double maxGuesses;
              bool gameOver;
              char playAgain;
              Random random = new Random();
  
  
  
              // Display title
              Console.WriteLine("Welcome to the high/low guessing game.");
              //Request user input for upper limit
              Console.WriteLine("Enter Upper range (e.g. 100):");
              upperLimit = Int32.Parse(Console.ReadLine());
  
              //Generate Random Number
              randomNumber = random.Next(1, upperLimit);
              maxGuesses = Math.Ceiling(Math.Log(upperLimit, 2) - 1);
  
              // Begin game
              Console.WriteLine("I picked a number between 1 and {0} you get {1} chances to guess it", upperLimit, maxGuesses);
  
              // Begin Guessing Process
  
              //Guess #1
              {
                  Console.WriteLine(" Enter Guess #1: ");
                  currentGuess = Int32.Parse(Console.ReadLine());
  
                  if (currentGuess == randomNumber)
                  {
                      Console.WriteLine("You got it!");
                  }
                  if (currentGuess &gt; randomNumber)
                  {
                      Console.WriteLine("Too High");
                  }
                  if (randomNumber &gt; currentGuess)
                  {
                      Console.WriteLine("Too Low");
                  }
  
                      Console.ReadLine();
                  }
              }
          }
      }
  </code></pre>