Question
Design and implement a Word Game program in which the user must identify a randomly selected password from a list of 8 words. The 8
Design and implement a Word Game program in which the user must identify a randomly selected password from a list of 8 words. The 8 words are selected at random from the list of 100 words in the starter file (word_game.py) BELOW
# Import the random module to allow us to select the word list and password at random. import random # Create a list of 100 words that are similar enough to work well for this game. candidateWords = ['AETHER', 'BADGED', 'BALDER', 'BANDED', 'BANTER', 'BARBER', 'BASHER', 'BATHED', 'BATHER', 'BEAMED', 'BEANED', 'BEAVER', 'BECKET', 'BEDDER', 'BEDELL', 'BEDRID', 'BEEPER', 'BEGGAR', 'BEGGED', 'BELIES', 'BELLES', 'BENDED', 'BENDEE', 'BETTER', 'BLAMER', 'BLOWER', 'BOBBER', 'BOLDER', 'BOLTER', 'BOMBER', 'BOOKER', 'BOPPER', 'BORDER', 'BOSKER', 'BOTHER', 'BOWYER', 'BRACER', 'BUDGER', 'BUMPER', 'BUSHER', 'BUSIER', 'CEILER', 'DEADEN', 'DEAFER', 'DEARER', 'DELVER', 'DENSER', 'DEXTER', 'EVADER', 'GELDED', 'GELDER', 'HEARER', 'HEIFER', 'HERDER', 'HIDDEN', 'JESTER', 'JUDDER', 'KIDDED', 'KIDDER', 'LEANER', 'LEAPER', 'LEASER', 'LEVIED', 'LEVIER', 'LEVIES', 'LIDDED', 'MADDER', 'MEANER', 'MENDER', 'MINDER', 'NEATER', 'NEEDED', 'NESTER', 'PENNER', 'PERTER', 'PEWTER', 'PODDED', 'PONDER', 'RADDED', 'REALER', 'REAVER', 'REEDED', 'REIVER', 'RELIER', 'RENDER', 'SEARER', 'SEDGES', 'SEEDED', 'SEISER', 'SETTER', 'SIDDUR', 'TEENER', 'TEMPER', 'TENDER', 'TERMER', 'VENDER', 'WEDDER', 'WEEDED', 'WELDED', 'YONDER'] The user has 4 attempts in which to guess the password. Whenever they guess incorrectly, they are told how many of the letters are the same between the word they guessed and the password. For example, if the password is COMEDY and they guessed MOULDY, they would be told that 3/6 letters were correct due to the O, D and Y being the same. Note that a letter must be in the correct position to be correct. e.g. in the example above, both words contain the letter M but it is in a different position in the word so it is not counted as a correct letter. Using this information, the user can make increasingly knowledgeable guesses and win the game by selecting the password within four guesses. If the user fails to select the correct word within 4 guesses, they lose the game.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started