import java.util.Scanner; 

public class GuessNumber {
  public static void main(String[] args) {
    // Generate a random number to be guessed
    int number = -50 + (int)(Math.random() * 51); // A change made here

    Scanner input = new Scanner(System.in);
    System.out.println("Guess a magic number between -50 and 50"); // A change made here

    int guess = -51; // A change made here
    while (guess != number) {
      // Prompt the user to guess the number
      System.out.print("\nEnter your guess: ");
      guess = input.nextInt();

      if (guess == number)
        System.out.println("Yes, the number is " + number);
      else if (guess > number)
        System.out.println("Your guess is too high");
      else
        System.out.println("Your guess is too low");
    } // End of loop
  }
}