Appearance
CS101 Word Game: Mini Wordle
python
import miniwordle2.MyWordGame as wg
words = wg.WGLib.parseWordsFile('lowerwords.txt')
wg.startSession(words)Brief Description
Guess the secret 5-letter word in a limited number of attempts of your choosing (between 1 and 10). After each guess, the game will show feedback for each letter: correct, misplaced or not in the word.
Settings
Word length: 5 (fixed for this version). Number of attempts: The player chooses how many attempts they want at the start of each game (between 1 and 10). If the player leaves the input blank, the default is 6 attempts. Scoring: Each guess scores points (2 points per G, 1 point per Y, 0 for not-in-word). Total score accumulates across turns in a single game. Hint system: (none) — optional DukeGPTHints.py is available but not used in game logic.
Rules of Play
The computer picks a random secret 5-letter word from lowerwords.txt. Each turn: The game shows previous guesses with feedback, remaining turns, and score. The player types a 5-letter word as a guess. If the guess is not exactly 5 alphabetic letters or not found in the allowed wordlist, the game prints "invalid" and prompts again. If the guess is valid, the game produces letter-by-letter feedback and updates the game state. End conditions: Win: player guesses the secret exactly (score > 0). Lose: player uses all turns without guessing the secret (score = 0).
Feedback Symbols After each guess, feedback is shown using three symbols:
G → Green — correct letter in the correct position Y → Yellow — correct letter but wrong position – → Gray — letter not in the word
Scoring Each guess earns points based on accuracy:
- +2 points for each G (correct letter, correct spot)
- +1 point for each Y (correct letter, wrong spot)
- +0 points for letters not in the word The total score is the sum of all points from all valid guesses.