The goal of this assignment is to write a program which simulates the classic game, Hangman.
See Exercise 5.36 on page. 201 for more detailed requirements. In addition to those requirements, please try to do the following:
The one drawback to our game right now is that someone needs to type
in the secret word, but presumably that shouldn't be the same person
who is guessing. In the long run, we will learn how to open up a
file of words and randomly select one, but for now, we'll
give the snipet of code that is required for this behavior. (The
filename used here is presuming you are working on turing - it could
be adjusted accordingly.)
from random import *
choices = file(filename)
secret = ''
linenum = 0
for word in choices:
linenum += 1
secret = word.strip()
You may safely assume that the underscore character (_) does not appear in any of the secrets.
Note: If you would like to use this file on some machine other than turing, feel free to download it (movies.txt) and save it on your own machine.
For this assignment, you are allowed to work with one other student if you wish (in fact, we suggest that you do so). If any student wishes to have a partner but has not been able to locate one, please let the instructor know so that we can match up partners.
You should create a new file, hangman.py, which contains all of the code. This file must be submitted electronically via email.
Use graphics creatively to animate a game in progress.