Appearance
CS101 Word Game: Ghost in the Shells
python
import ghostintheshells.MyWordGame as wg
words = wg.WGLib.parseWordsFile('lowerwords.txt')
wg.startSession(words)Brief Description
Ghost in the Shells is a spooky word-guessing challenge inspired by classic hangman mechanics. The player must reveal a hidden word by guessing one letter at a time before running out of lives. Each incorrect guess brings the ghost closer. Can you uncover the secret word in time?
Settings
Word source: lowerwords.txt (≈46k lowercase English words) Lives allowed: Player chooses between 3–10 per game Word length range: Player chooses minimum (4–8) and maximum (min–10) Replay: After each game, choose whether to play again (y/n) Reproducibility: Random seed can be set in startSession(words, seed=...)
Rules of Play
A secret word is chosen randomly from the dictionary within the chosen length range. Each turn displays: The masked word (letters and underscores _) The wrong letters guessed Remaining tries (lives) Turn number and score Enter a single letter (case-insensitive). Invalid inputs cause a message containing the word “invalid” and a reprompt. Correct guesses reveal all positions of that letter. Incorrect guesses reduce the number of lives by one. You win if you reveal all letters before lives reach zero (score = 1). You lose if you run out of lives (score = 0). After each game, the secret word and score are displayed, and you can choose to play again.