I'm working on this guessing game for school. I've realized that at some point I deleted my while loop for the user's guess equalling the computer's random number and it has messed up the results of my program. I thought that I could just add a nested while loop, but that hasn't worked. I've been trying to figure this out for hours. 

Any ideas how to add something like while (guess == number) to my code and keep it working?

```
/*
Programming Assignment #3: Guess
Peter Harmazinski 
Week 8

Guessing Game
*/

import java.util.*;

public class Guess {           
   public static final int RANGE = 100;       

   public static void main(String[] args) {  
      Scanner console = new Scanner(System.in);
      boolean again = true;
      double guessesDividedByGames = 0;
      int maxGuesses = 0;
      int numGames = 0;
      int numGuesses = 1;
      int totalGuesses = 0;
      Random rand = new Random();
      int number = rand.nextInt(RANGE) + 1;
      int guessTracker = 0;

      while(again) {
         getInstructions(); 
         int guess = getGuess(console);
         numGuesses = getHigherLower(guess, number, console);
         totalGuesses += numGuesses;
         again = playAgain(numGuesses, console);
         numGames++;  
         if (numGuesses > maxGuesses) {
             maxGuesses = numGuesses;
         }    
      }

      guessesDividedByGames = (double)totalGuesses / numGames;
      getResults(numGames, totalGuesses, guessesDividedByGames, maxGuesses);
   }

   //Prints instructions for user
   public static void getInstructions() {
      System.out.println("This program allows you to play a guessing game");
      System.out.println("I will think of a number between 1 and " + RANGE);
      System.out.println("and will allow you to guess until you get it.");
      System.out.println("For each guess, I will tell you whether the");
      System.out.println("right answer is higher or lower than your guess");
      System.out.println("");
   }

   //Allows the user to play again if first letter of input is "y" or "Y"
   public static boolean playAgain(int guessesNum, Scanner console) {
      boolean anotherTime = false;
      System.out.println("You got it right in " + guessesNum + " guesses.");
      System.out.println("");
      System.out.print("Do you want to play again? ");
      String repeat = console.next();
      String[] yesOrNo = repeat.split("");
      System.out.println("");
      if (yesOrNo[0].equals("y") || yesOrNo[0].equals("Y")) {
         anotherTime = true;
      }
      return anotherTime;
   }

   //Outputs the results if the user doesn't play again
   public static void getResults(int gamesTotal, int guessesTotal, double guessesDividedByGames, int guessesMax) {
      System.out.println("Overall results:");
      System.out.println("\ttotal games\t= " + gamesTotal);
      System.out.println("\ttotal guesses\t= " + guessesTotal);
      System.out.println("\tguesses/game\t= " + guessesDividedByGames);
      System.out.println("\tmax guesses\t= " + guessesMax);   
   }

   //Tells the user whether the random number is higher or lower
   //and then returns the number of guesses
   public static int getHigherLower(int guess, int randomNumber, Scanner console) {
      int guessIncreaser = 1;
      while (guess > randomNumber) {
         System.out.println("lower");
         guess = getGuess(console);
         guessIncreaser++;
      }
      while (guess < randomNumber) {
         System.out.println("higher");
         guess = getGuess(console);
         guessIncreaser++;
      }
      return guessIncreaser;
   }

   //Asks the user to guess the random number 
   //then returns the guess
   public static int getGuess(Scanner console) {
      System.out.println("I'm thinking of a number...");
      System.out.print("Your Guess? ");
      int playerGuess = console.nextInt();
      while (playerGuess < 1 || playerGuess > RANGE) {
         System.out.println("Out of range, please try again.");
         System.out.print("Your Guess? ");
         playerGuess = console.nextInt();
      }
      return playerGuess;
   }
}

```