The program you'll create in this chapter is the classic number guessing game. For those who missed out on this game in their childhood, the game goes like this: the computer chooses a random number between 1 and 100 and the player tries to guess it in as few attempts as possible. Each time the player enters a guess, the computer tells the player whether the guess is too high, too low, or right on the money. Once the player guesses the number, the game is over. Figure 3.1 shows Guess My Number in action.
Figure 3.1: Got it in only three guesses! Try to beat that.