In this chapter, you’re going to make a Guess the Number game. The computer will think of a secret number from 1 to 20 and ask the user to guess it. After each guess, the computer will tell the user whether the number is too high or too low. The user wins if they can guess the number within six tries.
This is a good game to code because it covers many programming concepts in a short program. You’ll learn how to convert values to different data types and when you would need to do this. Since this program is a game, from now on we’ll call the user the player.