The Wheel of Fortune is a game show where contestants guess a word or phrase

Do My Homework Service Links: Online Assignment Help, Do My Assignments Online -

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[3]
  • 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=:
  • '{}'.format(var)
  • '%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.
  • Forbidden:
  • 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 _ _ _ _

Some hints:

  • 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

  1. Take in a word / phrase to use for the game.
  2. Display the word with blanks for unguessed letters.
  3. Spaces should be left in the word. No commas, periods, or any other grammatical marks will be used.  
  4. Take in a guess.
  5. If that guess is "solve" then take in a total solution guess and compare it to the solution word/phrase.
  6. If it's correct, you win.
  7. Otherwise keep playing.
  8. If that guess is a letter then check to see if it's in the word (regardless of case).
  9. If it is, display the partial word with the letter added. Use underscores for any letter not yet guessed.  
  10. If it isn't, inform the user that the letter isn't in the word.  
  11. Check to make sure that the letter is actually length 1.
  12. Check to make sure we haven't guessed that letter before.  
  13. If solved, then you win, end the game/program.
  14. 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

Related Questions

Find Related Questions Here