import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Random;

public class Guess
{
    public static void main(String[] args) throws Exception
    {
        // Create a BufferedReader for reading strings instead of raw bytes from
        // standard input
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        
        Random rand = new Random();
        int number = rand.nextInt(100) + 1;
        int guess = -1;
        int numGuess = 0;
        
        System.out.println("Guess on a number between 1 and 100");
        while(guess != number)
        {
            numGuess++;
            System.out.print("Your guess: ");
            guess = Integer.parseInt(in.readLine());
            if(number > guess)
            {
                System.out.println("The number is bigger");
            }
            else if(number < guess)
            {
                System.out.println("The number is smaller");
            }
        }
        System.out.println("It did take you " + numGuess + " tries to find the number.");
    }
}