Appearance
CS101 Word Game: Word Guess
python
import wordguess.MyWordGame as wg
words = wg.WGLib.parseWordsFile('lowerwords.txt')
wg.startSession(words)Brief Description
The game Word-Guess is a console word game remniscent of NY Times' Wordle. The goal is to guess a four-seven letter word within a limited number of attempts. The score would be based on earning points within performance.
Settings
At the start of the game, the player is prompted for two settings: Turns: The player may enter between 1 and 6, denoting the number of turns/guesses they will have. Word Length: The player chooses the length of the word between 4 and 7 (which is then randomly selected from lowerwords.txt).
Rules of Play
At the start of the game, a random English word at the player's chosen length (4 - 7) will be randomly selected as the root word. The player chooses how many turns they want from 1 to 6 At each turn, the player enters a guess. A guess g is only valid if and only if: g has the same number of letters as the root word g consists of only alphabetic letters g if found in the word file: lowerwords.txt Invalid guesses are shown to be invalid, then the user is reprompted for another guess.
After each valid guess, the game provides feedback for each letter: Correct letter in correct position, the letter shows as [G] for GREEN Correct letter but in wrong position, the letter shows as [Y] for YELLOW letter not in word appears the same, the letter shows as [X]
If the player guesses the secret word correctly, the game ends immediately with a congratulatory message. If the player runs out of turns without guessing the secret word, the correct word is revealed. Scoring: Correctly guessing the word within n turns awards (7 − n) × 10 points. If the player fails to guess the word, they earn 0 points.
At the end of the game, the player’s final score and the secret word are displayed.