Question
Hi! I don't know which clarification or information do you need. Here is full detailed information. Let me know in the comments if you have
Hi! I don't know which clarification or information do you need. Here is full detailed information. Let me know in the comments if you have any confusion at any point. Thanks
Task 3B - Monster You will be part of a program that will help set up an adventure game. The part you are going to implement should handle a cave in which the game takes place, and the monsters in the game. The cave consists of different rooms and these rooms can contain monsters, sometimes several. Your program should be helpful in designing the cave by providing the ability to add rooms and monsters, as well as showcasing the entire cave and selected parts of the cave's contents. The requirements that you must meet in your program are listed here: In the game, a monster must be represented by a dictionary with a key for names that must have a string as a value, a key for ID numbers that must have a unique integer as value and a key for viability that must have a floating point value. 2. The cave shall be represented by a dictionary where the keys represent rooms and shall be integers, the values shall consist of lists containing the monsters of the rooms. If a room does not contain any monsters, the list for the room should be empty. 3. There must be a function that takes a string, a floating point number and possibly an integer as input parameters, and that creates and returns a monster dictionary with the submitted string as the name, the submitted floating point number as the force of life value and the integer number as the ID number (it is allowed to generate the ID number inside the function if you want). 4. Write a function where you can submit a cave dictionary and which returns the total number of monsters in the entire cave. 5. Write a function takes a monster dictionary as a parameter and can display a monster on the screen. For example like this: Id: 17 Name: Gohdan Life force: 2000.0 6. Write a function that takes a cave dictionary and a room number, and displays all the information about the room on the screen. For example like this: Room number: 19 The room contains 2 monsters -------------------- Id: 17 Name: Gohdan Life force: 2000.0 -------------------- Id: 265 Name: Moldtahalon Life force: 17.23 -------------------- 7. Enter a function that reads information about a room (including the monsters in the room) from terminal input, and returns a dictionary with a key-value pair with the room number as the key and a monster list as the value. 8. Write a function that writes all the information about a room to a file. The function should take a room number and a monster list as parameters. The file should be named "Room # .txt", where # refers to the room number. 9. Write a general function that takes two dictionaries as parameters and adds the key-value pairs from the second dictionary to the first. The function is called with advantage when a room is to be added to the cave. 10. Type a menu-based application that has the following options: A. Add a room B. Add a monster C. Write a room to file D. Show a room E. View the entire cave X. Quit the program 11. If you make an incorrect menu selection, an error message will be printed and a new entry will be requested. If you try to add a monster to a room that does not exist, an error message will be printed. Negative numbers should also not be tolerated as room numbers or as vitality value. Other error handling is not required. You can of course create more functions in your program than those required in the list above, to create a better structure if you want. All functions in the list of requirements must be used in your program.
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