Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You've landed on an alien planet, in the middle of some strange maze, and you want to find the quickest way out. The maze can

You've landed on an alien planet, in the middle of some strange maze, and you want to find the quickest way out. The maze can be thought of as a mn grid where some of the squares in the grid are blocked. You know the entire maze (including the size of the grid, which squares are blocked, and your current location). You can drive north, south, west, or east from each square in your hovercar, but not diagonally. Unfortunately, your hovercar was damaged during the rough landing onto the planet, and it can't turn left or make Uturns: the hovercar can only go straight or turn right. For instance, if you leave the current square by going north, you'll only be able to leave the next square by going north or east; west is not possible, because that would require a left turn, and south is not possible either, because would require a U-turn. Your hovercar was landed facing north, so on your first move you will need to drive north. Find an efficient algorithm to find the shortest route to escape from the maze and implement it. Input maze should be in text file filled with some characters, for example "." Could represent empty area, "*" could represent block, "c" could represents the car, "e" could represent the exit. You must provide many sample inputs (many text files) during the discussion time, to test your project on many samples. Each text file represents one Maze.

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Programming questions

Question

1. What is Ebola ? 2.Heart is a muscle? 3. Artificial lighting?

Answered: 1 week ago