Python Programming for the Absolute Beginner, 3rd Edition

The project for this chapter is the game of hangman. The computer picks a secret word and the player has to try to guess it, one letter at a time. Each time the player makes an incorrect guess, the computer shows a new image of a figure being hanged. If the player doesn't guess the word in time, the stick figure is a goner. Figures 5.1 through 5.3 show off the game in all its glory.

Figure 5.1: The "Hangman" game in action. Hmm . . . I wonder what the word could be.

Figure 5.2: I won this game!

Figure 5.3: This game ended badly, especially for the little guy made of text.

Not only is this game fun, but by the end of the chapter, you'll know how to create your own version. You can have a personalized group of secret words, and even update my marginally adequate artwork.

Категории