Hangman

From WLCS

Objective(s)

  • You will design and implement a program that plays Hangman
  • You will use and manipulate strings
  • You will use and manipulate lists
  • You will use file input
  • You will use functions
  • You will use loops

Directions

Planning & Design:

  1. Review the rules of Hangman
  2. Open a Google Doc and name it Hangman Design
  3. Put your name at the top
  4. Add sub-headings for the following: Variables & Types, Requirements, Design
  5. Under the Variables & Types section, list all the variables that you expect to use and their types (be sure to identify any lists)
  6. Under the Requirements section, list all the rules and requirements for the Hangman game
    • These should be the big picture requirements of how the game works
  7. Under the Design section, write the step-by-step English instructions/pseudocode of your Hangman game
    • This should be the plain language, specific step-by-step instructions of the program (different from rules)
    • You should detail and describe any input or output
    • Be sure to detail what exactly happens in each step (e.g. check each letter of the secret word to see if it matches the guessed letter...)
    • You should include every step from the very beginning when the game starts up until when the game ends
  8. Submit the Hangman Design via Google Classroom

Requirements (at a minimum):

  1. The secret word should be picked randomly from a text file of random words (you create the text file)
  2. Player should be allowed to guess a letter
  3. Player is only allowed 7 incorrect guesses (display number of incorrect guesses left every turn)
  4. Correct letters are revealed in the secret word
  5. Incorrect letters are added to an incorrect list
  6. Game over when all letters are revealed correctly or when the player is out of guesses

Advanced Requirements:

  1. Your game is idiot-proof (i.e. player cannot input invalid keys, numbers, or words unless the word is the solution)
  2. Your game can handle multiple words (i.e. hyphens and spaces are shown automatically)
  3. Your game handles upper and lower case letters the same (i.e. guessing 'a' or 'A' reveals all the upper and lower As)
  4. Print out a fake graphical hangman in the console (Example)