This project implements a two-player word game inspired by the TV show Countdown. Players are challenged to create the longest valid word using a random selection of letters provided by the program. The letters are composed of both vowels and consonants, with the player deciding how many vowels to include (between 3 and 5).
The program operates through:
Randomized Letter Generation: A pool of vowels and consonants, weighted by their frequency in English, is used to create the letter set. A random number generator selects 9 letters, ensuring that the specified number of vowels is included.
Word Submission: Each player submits a word they’ve formed using the provided letters. The program checks if the submitted word: Uses only the provided letters (without reusing any). Exists in a preloaded dictionary of valid words (from a file called words.txt).
Winner Determination: The program compares the two words based on: Validity (whether the word is both constructible and real). Length (longer valid words win). A winner is declared, or the game ends in a tie if the words are of equal length.
Longest Word Discovery: The program searches the dictionary to find the longest valid word that could have been formed from the given letters. This provides players with a fun insight into what was possible.
Replay Option:After each round, players are prompted to decide whether they want to play again. The program features a modular design, including:
Functions for random letter generation, word validation, and gameplay. Use of external files to validate words, making the game adaptable to different dictionaries. The key objectives of the game are to test players' vocabulary, strategy, and speed while providing an engaging and educational experience.