I need help mapping out my rooms with the dictionary and then use…
Question Answered step-by-step I need help mapping out my rooms with the dictionary and then use… I need help mapping out my rooms with the dictionary and then use the user’s input to see if that direction exists. It will shorten up my logic here to just a handful of lines and reduce some of my complexity. The same with getting an item. I need help writing this is pseudocode or a flow chart. Storyline :The joker has taken over a cruise ship and in matter of minutes it will sink. You need to defeat the joker before you and the other passengers become his next victims, but before you fight him you will need a few items. You will need a map from the captain’s stateroom to learn how to get around the ship, a belt from the bathroom so you have a variety of gadgets to fight him with, a costume from the laundry room to conceal your identity, a rope from the engine room to detain him with, a boomerang from the cigar bar to neutralize him, and finally a key from the galley to unlock the door to the cockpit to defeat the joker. Moving between rooms ——————– INITIALIZE present_room = “Dining Room” LOOP BEGIN INPUT direction IF present_room IS “Dining Room” IF direction IS “North” present_room = “Captain’s Stateroom” ELSE IF direction IS “South” present_room = “Laundry Room” ELSE IF direction IS “West” present_room = “Cigar Bar” ELSE IF direction IS “East” present_room = “Galley” ELSE OUPUT “Wrong way Batman!” ELSE IF present_room IS “Captain’s Stateroom” IF direction IS “South” present_room = “Dining Room” ELSE IF direction IS “East” present_room = “Bathroom” ELSE OUPUT “Wrong Way Batman!” ELSE IF present_room IS “Bathroom” IF direction IS “West” present_room = “Captain’s Stateroom” ELSE OUPUT “Wrong Way Batman!” ELSE IF present_room IS “Cigar Bar” IF direction IS “East” present_room = “Dining Room” ELSE OUPUT “Wrong Way Batman!” ELSE IF present_room IS “Laundry Room” IF direction IS “North” present_room = “Dining Room” ELSE IF direction IS “East” present_room = “Engine Room” ELSE OUPUT “Wrong Way Batman!” ELSE IF present_room IS “Engine Room” IF direction IS “West” present_room = “Laundry Room” ELSE OUPUT “Wrong Way Batman!” ELSE IF present_room IS “Galley” IF direction IS “North” present_room = “Cockpit” ELSE IF direction IS “West” present_room = “Dining Room” ELSE OUPUT “Wrong Way Batman!” ELSE IF present_room IS “Cockpit” IF direction IS “South” present_room = “Galley” ELSE OUPUT “Wrong Way Batman!” GOTO LOOP BEGINLOOP END Get an Item—————————- Get Item function IF present_room IS “Cigar Bar” item = “Boomerang” ELIF present_room IS “Captain’s Stateroom” item = “Map” ELIF present_room IS “Bathroom” item = “Belt” ELIF present_room IS “Laundry Room” item = “Costume” ELIF present_room IS “Engine Room” item = “Rope” ELIF present_room IS “Galley” item = “Key” IF item not in Inventory OUTPUT “You see a” + item INPUT user_item IF user_item is item ADD item in the inventory OUPUT “Item collected” ELSE OUTPUT user_item + “not needed” Computer Science Engineering & Technology Python Programming CS 120 Share QuestionEmailCopy link Comments (0)


