Appearance
CS101 Word Game: Hangman 2.0
python
import hangman20.MyWordGame as wg
words = wg.WGLib.parseWordsFile('lowerwords.txt')
wg.startSession(words)Brief Description:
This is a Hangman-style word guessing game in which the player attempts to guess a secret word one letter at a time. The game provides feedback after each guess, showing which letters have been correctly guessed and how many misses remain. The player wins by revealing all letters only if they guess the word before running out of allowed misses.
Settings
Word List: The game uses a list of lowercase words Difficulty Levels: Easy: 12 allowed misses Hard: 8 allowed misses Random Seed (Optional): Used to make word selection reproducible. If no seed is provided, word selection is random each run.
Rules of Play
At the start, the player chooses a difficulty level (hard or easy). The game selects a secret word randomly from the word list. Each turn, the current state of the word is displayed: (correct letters revealed, unguessed letters as underscores). Letters already guessed and remaining misses are displayed. The player inputs a letter guess. If the guessed letter is in the word, all its positions are revealed. If the guessed letter is not in the word, the number of remaining misses decreases by one. The game ends when: The player correctly guesses all letters (win) The player runs out of misses (loss) After each game, the player can choose to play again or quit.