Question
Task: To complete this assignment, you should first write a 'recipe' that describes the components of the game and submit this file separately from the
Task: To complete this assignment, you should first write a 'recipe' that describes the components of the game and submit this file separately from the Python code. Next, you are to write a Python program that allows users to input basic demographic information (minimum of three pieces of demographic information) and then to create a collection of three items, with each item having at least two pieces of metadata attached to them. After this initial phase of the game, each user is allowed to try and guess an item from the other's collection. Each user can only have X guesses (you define X, e.g., you could allow a user guess a maximum of 10 times) before the game ends. You can alternate guessing or have one user guess all their guesses at one time.
- Output a welcome message describing the application for the user and any/all instructions
- At each step, give them the option to quit the game (i.e. In instructions, inform the players they may quit at any time by typing "Q" or something similar)
- If a player quits, thank them for playing in a professional manner
- Output score (if they've started guessing)
- Ask the first player to input their demographic information (min of 3 pieces of info and you must include first name as one of the pieces of demographic information) and store the data
- Validate data where applicable; e.g., if you ask for age, verify that they've given you an integer and not a string
- Output blank lines (as you did in the previous assignment) and then ask for the second player's information.
- Once demographic information is stored for both players, first ask the second player to hide their eyes and then ask the first player to input information for each item (minimum of three) in their collection.
- Ask them by their first name (from the data you gathered in step #2)
- This should include the item itself and the two pieces of metadata about the item (e.g. item=book; title=Neuromancer; author=William Gibson; year=1984)
- Remember that the other player will try to guess the item, so please choose to store different items in your collection -- or, for example, if you have three books in your collection, you need to allow the other player to search by title or some other piece of metadata! Otherwise, they can easily guess correctly by just entering 'book'.
- Repeat #4 for second player (don't forget to ask player one to hide their eyes).
- Once demographic information and the items are all entered, output blank lines to hide previous input from the screen
- Allow each player to guess the items in the other player's collection
- Keep score by adding one point for each correct guess to a counter for each player
- Keep a count of total guesses by adding one to a counter for each guess a player makes
- Finish the round after X guesses or when a player guesses all the items in the other's collection
- Present the option of playing again to the players at the end of the round
Criteria for success: You will receive a perfect score if you:
- Create a single recipe file and submit as *.txt or *.docx file separate from Python script
- Provide comments for each section of your code describing what the code is doing
- Add appropriate information to the docstring at the top of the script page in Spyder
- Follow the rules relating to variable naming (as presented in the lectures)
- Programmatically check to ensure player's have given you appropriate data
- Output all instructions and appropriate information at the appropriate time
- Utilize the dictionary mapping data type or a list and/or tuple sequence type to store information
- Utilize the control flow statements to iterate through your dictionary, list, and/or tuple
- Utilize the try:except for error control and to exit the program gracefully
- Utilize user-defined functions
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started