Introducing the Hangman Game


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.

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

click to expand
Figure 5.2: I won this game!

click to expand
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.




Python Programming for the Absolute Beginner
Python Programming for the Absolute Beginner, 3rd Edition
ISBN: 1435455002
EAN: 2147483647
Year: 2003
Pages: 194

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net