(question3.py) Write a word jumble game. In a word jumble the letters in a proper word are randomly
mixed up and the user has to guess what the word is. The list of words to be jumbled can be found on
D2L - jumble.txt. Here is one possible way to do this:
Write a function called getList() that reads in jumble.txt and stores the words in a list. Return
this list from the function as it will be needed by other functions.
Write a function called pickWord(). The function takes in one argument, a list of potential words.
In the function pick one word from the list - randomly - and return it. There are several ways to
Write a function called jumble(). This function takes in a single argument, a word and jumbles
the letters randomly. Again, there are several ways to do this. I won't put any algorithms here but
if you get stuck head to the discussion forums.
Your main() method is responsible for running all of the above functions. In addition it will collect
the user's guess of the jumbled word in the form of input and will check to see if the guess is correct.
Make sure that words are treated as case-insensitive to make the checking easier. The user should
always have several choices presented to them : Guess the jumbled word, re-jumble the same word,
pick a new word, show the answer or quit. When the user quits it should show them : how many
words they guessed correctly and how many words they skipped. Based on my output picking a
new word and showing the answer both count as skipping a word.
See my sample output below:
Edited 5 Years Ago by mekhoo: in python