Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

  1. Output a welcome message describing the application for the user and any/all instructions
  2. 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)
    1. If a player quits, thank them for playing in a professional manner
    2. Output score (if they've started guessing)
  3. 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
    1. Validate data where applicable; e.g., if you ask for age, verify that they've given you an integer and not a string
  4. Output blank lines (as you did in the previous assignment) and then ask for the second player's information.
  5. 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.
    1. Ask them by their first name (from the data you gathered in step #2)
    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)
      1. 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'.
  6. Repeat #4 for second player (don't forget to ask player one to hide their eyes).
  7. Once demographic information and the items are all entered, output blank lines to hide previous input from the screen
  8. Allow each player to guess the items in the other player's collection
    1. Keep score by adding one point for each correct guess to a counter for each player
    2. Keep a count of total guesses by adding one to a counter for each guess a player makes
  9. Finish the round after X guesses or when a player guesses all the items in the other's collection
  10. 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Flash XML Applications Use AS2 And AS3 To Create Photo Galleries Menus And Databases

Authors: Joachim Schnier

1st Edition

0240809173, 978-0240809175

Students also viewed these Databases questions

Question

3. List ways to manage relationship dynamics

Answered: 1 week ago