Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Let's create a dungeon! The following features will be created: - Load map - Find start - Game loop - Get command - Escape (quit

image text in transcribed
image text in transcribed
Let's create a dungeon! The following features will be created: - Load map - Find start - Game loop - Get command - Escape (quit game) The start position for the player is a cell that contains "S". For example, the Cave map is a 55 grid: S would be the starting position for the player, and F would be the target destination. The available path is presented with * (star) characters. - (dash) is a wall, the player can not go in that direction. What to do First, define the MAP_FILE constant (as in the template below). Continue by implementing the load_map(), find_start(), and get_command() functions. 1. Implement the load_map () function that would load a map from a given text file and return it as a grid (nested list). 2. Implement the find_start () function that takes the map (as a nested list) and finds the starting position of the player on the map. In the example above, the function would return [0,2]. 3. Implement the get_command () function that prompts the user for a command and returns the entered command. 4. Implement the main () function with the following functionality: a) Load data from a text file into a nested list b) Display the nested list (as is, for debugging purposes) c) Find and display the starting position d) Ask the user for a command. If the user enters escape, quit the program. Otherwise, display I do not understand. and ask again. Use the following template. All functions defined in the template must be present and implemented in your code (you may not omit functions). You may add extra functions if needed. Hints

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

Data Mining Concepts And Techniques

Authors: Jiawei Han, Micheline Kamber, Jian Pei

3rd Edition

0123814790, 9780123814791

More Books

Students also viewed these Databases questions