Overview

It is hard to start programming because the results of learning come much later. However, this project should give good results if you work at it long enough. We will be making a command-line game for hangman.

Understandings

  1. Logic
    • Combining expressions
    • In / Not In keywords
  2. Code blocks
  3. Array indexing
    • Retrieval
    • Assignment
    • Appending
  4. Conditionals
  5. Using random to choose a random element from a list

Procedure

  1. Have the program generate a random word.
  2. Print as many blanks as letters in the word.
  3. Ask the user for a guess.
  4. Determine if the guess is correct or invalid.
  5. If the guess is correct, update the displayed word.
  6. If the guess is wrong, decrease the amount of “lives” that the user has.
  7. Continue until the user has lost or guessed the whole word.

Next lesson

Previous lesson