Write a Maze Explorer program, [login to view URL], that uses stacks and queues to implement an algorithm to escape from a maze. The overall pseudocode of the algorithm is the following.
create an empty stack of locations to explore.
push the start location onto the stack.
while ( stack is not empty ) {
pop a location loc from the stack.
if we have pulled loc from the stack before:
no need to explore it again, so skip loc.
if loc is the end location:
the end was reachable!
else, loc is a new reachable non-finish location, so explore it:
add all non-wall adjacent maze locations to the stack.
record the fact that we have explored loc.
}
if the stack is empty, the finish is unreachable.
A maze is specified by a file which contains a text encoding for the maze, where S represents the start location, F represents the finish location, W represents a wall, and O represents a location we can explore. A path through the maze can only consist of steps going left, right, up, or down, no diagonals are allowed.
Two mazes are provided as input: [login to view URL] (in which the end is reachable) and [login to view URL] (inwhich, the end is not reachable).
Here is a sample maze:
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
WSOOOOOOOOOOOOOOWOOOOOOOOOOOOOOOOOWOOOOOOOOOOOOOOOWOOOOOOW
WWOOOOOOOOOOOOOWWWWWWWWWWWWWOOOOOOOOOOWWWWWWWWWWWWWOOOOOOW
WWWWWWOOOOOOOOOOOOWWWWWWWOOOOOOOOOOOOWWWWWWWWWWWWWWWWOOOOW
WOOOOOOWWWWWWWWWWWWWWOOOOOOOOOOOWWWWWWWWWWWOOOOOOOOOOOOWWW
WOOOOWWWWWWWOOOOOOWWWWOOOOOOWWWWWWWWWWWOOOOWWWWWWWWWOWWWWW
WOOOWWWWWWWWWWWWOOWWWWWWWWWWWWOOOOOOOOOOOOWWWWWWWWWOOOOOWW
WOOWWWWWWWWWWWWWOOWWWWWWWWWWWWWWWWWOOOOOOOWWWWWWWWWWWWOOOW
WOWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWOOOOOOOWWWWWWWWWWWOOW
WOWWWWWWWWWWWWWOOOOOOOOOOOOOOOOOOOOOOOOOOOOWWWWWWWWWWWWOOW
WOOOOOOOOOOOOOOOOWWWWOOOOOOOOWWWWWWWOOOOOOWWWWWWWWWWWWWWFW
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
One possible solution:
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
WsOOOOOOOOOOOOOOWOOOOOOOOOOOOOOOOOWOOOOOOOOOOOOOOOWOOOOOOW
WWOOOOOOOOOOOOOWWWWWWWWWWWWWOOOOOOOOOOWWWWWWWWWWWWWOOOOOOW
WWWWWWOOOOOOOOOOOOWWWWWWWOOOOOOOOOOOOWWWWWWWWWWWWWWWWOOOOW
WOOOOOOWWWWWWWWWWWWWWOOOOOOOOOOOWWWWWWWWOOOOOOOOOOOOOOOWWW
WOOOOWWWWWWWOOOOOOWWWWOOOOOOWWWWWWWWWWWOOOOWWWWWWWWWOWWWWW
WOOOWWWWWWWWWWWWOOWWWWWWWWWWWWOOOOOOOOOOOOWWWWWWWWWOOOOOWW
WOOWWWWWWWWWWWWWOOWWWWWWWWWWWWWWWWWOOOOOOOWWWWWWWWWWWWOOOW
WOWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWOOOOOOOWWWWWWWWWWWOOW
WOWWWWWWWWWWWWWOOOOOOOOOOOOOOOOOOOOOOOOOOOOWWWWWWWWWWWWOOW
WOOOOOOOOOOOOOOOOWWWWOOOOOOOOWWWWWWWOOOOOOWWWWWWWWWWWWWOf
W
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
Extra Credit: Come up with your own maze, submit it as myMaze.txt.
Extra Extra Credit: Print a list of directions to follow from S to F.
hello,
i already make this algorithm before in one of my college Assignment.
please refer to find the bomb project in my portfolio to see sc shoot about the maze that i did before..it have the same properties as your maze (start point,finish point, walls)
thanks
Hi, I am placing my bid on your project because I have read the requirements and I am confident enough with my Java and algorithm skills. I am focused mostly on doing computer science homework here in freelancer.com and I would like to help you get this project done if you would give me the opportunity. I am a computer science professor and practitioner and this assignment is one of the fields that I teach very well so I can assure you an accurate result.
Let me know if you are interested so I can start. Thanks.
I have one year experience in java.
I have done 6 years study in computers(BCA and MCA).
I am Oracle Certified in Java also. I hope you will shortlist me for this job.
I will do my work with perfection and 100% commitment. And I dont want
any milestone before your satisfaction with my performance.
Thanks
I can do this easily I am going to get started tomorrow as it is very late over here in Ireland but I am going to create this anyway regardless if you accept my bid or not I should have it for you sometime tomorrow for you to have a look at and if you want to buy it you can