Compsci 101, Fall 2017, Hangman How-to

Part 1

Hangman guidelines and getting started.

code directory

  1. You should snarf code or visit the code directory. You will modify PlayHangman.py that is provided for the Hangman game of words.

  2. The sample output on the assignment writeup page should be generically followed in that the user should see a representation of the secret word with guesses filled in, the letters and words guessed so far, and so on. Also see the requirements on that page.

  3. Do Lab 6 first as it gets you started with Part 1.

Part 2

  1. Once PlayHangman.py is complete, make a copy of it named PlayHangmanMovies.py for the movie version of Hangman with guessing movie titles.

  2. You will have to change getPossibleWords to return a list of titles with "length" words.
  3. Some of the movie titles may have nonalphabetic letters in them. You should show those characters. The user should not guess them. For example, the title "Saw 3D: The Final Chapter" would be started as (note the '3' and ":" and the blanks):
  4.         ['_','_','_',' ','3','_',':',' ','_','_','_',' ','_','_','_','_','_', 
    
               ' ','_','_','_','_','_','_','_']     
    

    You'll need to modify the guessStart method to start this way. Suggest you generate all the characters in the list as '_', and then fill in the blanks and any nonalphabetic characters. You can use ch.isalpha() to determine if a character is an alphabetic character.

  5. Write a function to determine how many of the words are not complete yet (still have "_" in them). It might be easier to do this by converting the guess so far into a string and then a list of words.
  6. See the requirements for this part on the main page.