t s a y eand the unjumbled word is outlined like this:
_ ? ? _ _where the question marks indicate where the vowels should be inserted. A typical Jumble puzzle has 4-6 such jumbled words, that once unjumbled, make a small joke or answer a riddle.
Your assignment is to design and build a Python program, named Jumble.py, that reads an English word as its input, then jumbles the word, presents it in the above format, and lets the user interactively move the letters back into their proper positions in the original word. For simplicity, assume that the input word will have a length of 10 letters or less.
Please type a word: enterprise Here is your puzzle: guesses = 0 0 1 2 3 4 5 6 7 8 9 t e s r p n e r i e ? _ _ ? _ _ _ ? _ ? 0 1 2 3 4 5 6 7 8 9 Please type the number of the letter you wish to move: 5 Please type the number of the letter's destination: 1 Correct! Here is your puzzle: guesses = 1 0 1 2 3 4 5 6 7 8 t e s r p e r i e ? n _ ? _ _ _ ? _ ? 0 1 2 3 4 5 6 7 8 9 Please type the number of the letter you wish to move: 7 Please type the number of the letter's destination: 0 Incorrect! Here is your puzzle: guesses = 2 0 1 2 3 4 5 6 7 8 t e s r p e r i e ? n _ ? _ _ _ ? _ ? 0 1 2 3 4 5 6 7 8 9 Please type the position of the letter you wish to move: ... etc. ...The program lets the user play until all the letters are moved from the jumbled word into the unjumbled one. The jumbled word shrinks in size, until we reach the end of the game:
Here is your puzzle: guesses = 2358 0 r e n t e _ p r i s e 0 1 2 3 4 5 6 7 8 9 Please type the position of the letter you wish to move: 0 Please type the number of the letter's destination: 4 Correct! Congratulations! You completed the puzzle in 2359 guesses! e n t e r p r i s e 0 1 2 3 4 5 6 7 8 9 Press the Enter key to finish.
Make a list to hold the unjumbled word, and make it hold only "_" and "?" letters at first. (For the example, we started with ["?", "_", "_", "?", "_", "_", "_", "?", "_", "?"]). Write a loop to let the user repeatedly move letters from the jumbled word into the unjumbled list. It is best to build your program in several stages. If you run out of time, submit what you have on the deadline for partial credit:
Reminder: This is a single-person assignment. You are welcome to discuss the assignment with your instructors, tutors, and other students, but the algorithm you design and the program you write and submit must be your own work, just as if you are submitting an essay for an English Composition course.