The Wheel of Fortune is a game show where contestants guess a word or phrase
Allowed, Required and Forbidden
- Required: Use if __name__ == '__main__' in each file.
- Required: Put headers on the tops of your files as usual.
- Allowed: The following keywords, builtins, and operators
- Declaring and assigning variables
- Using +, -, *, /, //, %, ** where appropriate
- Using +=, -=, *=, /=, //=, %=, **=
- Comparisons ==, <=, >=, >, <, !=, in
- if/elif/else; and, or, not
- Casting int(x), str(x), float(x), (technically bool(x))
- For loops
- While loops
- Lists, list(), indexing, i.e. my_list[i] or my_list
- 2d-lists if you want them/need them my_2d[i][j]
- Append, remove
- String operations, concatenation +, +=, split(), strip(), join(), upper(), lower(), isupper(), islower()
- Print, with string formatting, with end= or sep=:
- '%d' % some_int
- Really the point is that we don't care how you format strings in Python
- Ord, chr, but you won't need them this time.
- Input, again with string formatting in the prompt, casting the returned value.
- Min, max, map, lambda, sort, sorted, dictionaries
- Importing a library not specified in the problem
- Declaring your own functions
- List slices, string slices, unpacking *list
- Other list functions (count, index, pop, sort, etc.)
- break, continue
Problem 5 - Rota Fortunae
The Wheel of Fortune is a game show where contestants guess a word or phrase.
Whenever they guess a single letter, if it is part of the word or phrase, all of the letters of that kind are revealed.
For instance if the word is Happy, we would see _ _ _ _ _ at first. If the user guesses "p" then we would reveal _ _ p p _.
If the phrase was like "Hector has a house" and so the hidden letters are _ _ _ _ _ _ | _ _ _ | _ | _ _ _ _ _ and "h" is guessed, we should reveal both the upper and lower case:
H _ _ _ _ _ | h _ _ | _ | h _ _ _ _
- If you want to convert a string to a list of characters use list(my_string).
- You can use string concatenation or sep.join to make the display string.
- Don't make the user guess spaces since they'll be displayed already.
- You don't have to display pipes for spaces like in the examples above, it's just done for clarity.
Your program should do the following
- Take in a word / phrase to use for the game.
- Display the word with blanks for unguessed letters.
- Spaces should be left in the word. No commas, periods, or any other grammatical marks will be used.
- Take in a guess.
- If that guess is "solve" then take in a total solution guess and compare it to the solution word/phrase.
- If it's correct, you win.
- Otherwise keep playing.
- If that guess is a letter then check to see if it's in the word (regardless of case).
- If it is, display the partial word with the letter added. Use underscores for any letter not yet guessed.
- If it isn't, inform the user that the letter isn't in the word.
- Check to make sure that the letter is actually length 1.
- Check to make sure we haven't guessed that letter before.
- If solved, then you win, end the game/program.
- Return to step 2
Get Help With a similar task to - The Wheel of Fortune is a game show where contestants guess a word or phrase
Tutlance Experts offer help in a wide range of topics. Here are some of our top services:
- Math homework help
- Nursing homework help
- Statistics homework help
- Nursing coursework help
- Capstone project writing services
- Essay writers for hire
- Case study writing help
- Buy college papers online
- Buy college research papers
- College homework help
- Professional resume writing services
- Programming homework help
- Coursework writing help
- Term paper writing help
- Biology homework help
- Do my physics homework
- Dissertation data analysis help
- PhD Dissertation writing services
- Chemistry homework help
Post your project now for free and watch professional experts outbid each other in just a few minutes.