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[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

Login to view and/or buy answers.. or post an answer

Related Questions

Similar orders to The Wheel of Fortune is a game show where contestants guess a word or phrase
8
Views
0
Answers
Inter-Process Communication (IPC) with Pipes in C
This is a C programming assignment to implement the parallel processing of input files using the fork(), waitpid(), and pipe() system calls. You will also use stat() and write() in each child process, and you will use read() in the parent process. Overa...
16
Views
0
Answers
The third programming project involves writing a program that allows the user to enter a binary tree.
Use original java code as well as original work for test plans and documentation. The third programming project involves writing a program that allows the user to enter a binary tree in a parenthesized prefix format and then allows it to be categorized a...
25
Views
0
Answers
Jupyter notebook tasks. Create a Python file dmv_record.py that contains the definition of a class named DmvCarRecord.
Create a Python file dmv_record.py that contains the definition of a class named DmvCarRecord. The class should include an __init__ method that initializes the following fields using optional parameters: license_num maker model year owner_id reg_ex...
24
Views
0
Answers
software design & development using flask
The objective of this exercise is to create a database-driven Flask application to keep track of guest attendance to an event. The application should enable users to perform the following 3 actions, which should be implemented as links in a navbar: 1. V...