The Java EE 6 Tutorial, Volume I

ProcedureRunning the guessnumber Example

  1. In a web browser, type the following URL:


    The Guess My Number page opens, as shown in Figure 18–2.

    Figure 18–2 Guess My Number Example

    Guess Number example at beginning of game

  2. Type a number in the Number text field, then click Guess.

    The minimum and maximum values are modified, along with the remaining number of guesses.

  3. Keep guessing numbers until you get the right answer or run out of guesses.

    If you get the right answer, the input field and Guess button are grayed out, as shown in Figure 18–3.

    Figure 18–3 Guess My Number at End of Game

    Guess Number example at end of game

  4. Click the Reset button to play the game again with a new random number.