Homework #2: Python
Due: Tuesday, January 31, 2006
You are to write a Python program that allows a user to play the word game hangman. Your version of hangman should play as follows:
- Upon startup, the game should ask the user their name, because the game needs to track players by name, number of words solved, average number of letters guessed per word, etc. If the user has never played before, the game should ask them their birthday. A player's age is used to select the difficulty of words selected for a player to solve while playing. You'll need to use files to store player information between games, and words previously categorized by difficulty.
- When playing hangman the game selects an appropriate word at random based on the player's age. Even though words as selected at random, the player should not encounter the same word more that once until all of the words in that level of difficulty have been exhausted. A simple textual interface can be used to interact with the player, it should include a list of the guessed letters, a list of the unguessed letters, the number of guess so far, etc. For example, your interaction might look something like:
...
4 Letters Guessed: A E T R
Unguessed Letters: B C D F G H I J K L M N O P Q S U V W X Y Z
Number of incorrect word guesses: 1
T E A ___ ___ E R
Enter the next letter or your guess of the word:
- After a player solves a word, they should be asked if they would like to do another word.
- When a player quits, their overall statistics should be displayed.
You are to hand in:
- a one page overview of the design of your program,
- a hard-copy of your program, and
- the output produced by running your program. In Windows, IDLE has a File | Print Window menu options that you can use, but in Linux you'll probably need to use the Graphics | Screen Capture utility from the "main" KDE icon (the big K in lower-left-hand corner of the screen).