Appearance
CS101 Word Game: Secret Word Reveal
python
import secretwordreveal.MyWordGame as wg
words = wg.WGLib.parseWordsFile('lowerwords.txt')
wg.startSession(words)Brief Description
Secret word reveal is a console word-guessing game that emphasizes careful, letter by letter deduction. Before play starts you choose the target word length and how many misses you will allow yourself. During the game the interface shows the underscores for unknown letters, your sorted list of guesses, and your remaining misses. Because repeated letters are revealed everywhere at once, each correct guess can be highly informative, while incorrected guesses steadily reduce your remaining chances.
Settings
Word length: integer 3-7 You choose the target length for the secret word before the game starts.
- If you enter something outside of this range or not an integer, the game will reprompt until a valid value is given.
- The game filters the built-in word list ('lowerwords.txt') to words of exactly this length. Misses allowed: integer 3-10 You choose how many incorrect guesses you want to allow yourself.
- If you enter something outside of this range or not an integer, the game will reprompt until a valid value is given.
- Each time you guess a letter that is not in the secret word, your "misses left" decreases by 1. The game ends in a loss when it reaches 0. Settings are only applied to the current game. If you choose to play again, you can pick new settings. If the chosen word length has no matching words in the list, you will be asked to choose a different length.
Rules of Play
Before the game starts, you choose: Word Length (3-8) Misses Allowed (5-10) The game secretly picks a valid English word of the chosen length from 'lowerwords.txt' Each turn: the game shows your current progress (underscores for unknown letters), your guessed letters, and misses remaining. you enter one letter. Repeats and non-letters are invalid and wll be reprompted. if your letter appears in the secret word, all positons are revealedl otherwise, your misses remaining decreases by 1. to WIN - reveal all letters before misses run out. you LOSE if misses reach 0 first. Score determined - if you win, 10 + 'misses left', if you lose, '0'